We now have all the code written to take the control for a test run. Proceed as follows:
- Open MainPage.xaml.cs.
- Add a using statement for the Swiper.Controls (using Swiper.Controls;).
- Add the following code marked in bold to the constructor:
public MainPage()
{
InitializeComponent();
MainGrid.Children.Add(new SwiperControl());
}
If all goes well with the build, we should end up with an photo like the one shown in the following screenshot:
We can also drag the photo around (pan it). Notice the slight lift effect when you begin dragging, and the rotation of the photo based on the amount of translation, which is the total movement. If you let go of the photo, it animates back into place.