Getting started with WPF TouchManager
This article demonstrates a simple image gallery implemented with TouchManager and demonstrates the basic usage of the manager.
Adding Telerik Assemblies Using NuGet
To use TouchManager when working with NuGet packages, install the Telerik.Windows.Controls.for.Wpf.Xaml
package. The package name may vary slightly based on the Telerik dlls set - Xaml or NoXaml
Read more about NuGet installation in the Installing UI for WPF from NuGet Package article.
With the 2025 Q1 release, the Telerik UI for WPF has a new licensing mechanism. You can learn more about it here.
Adding Assembly References Manually
If you are not using NuGet packages, you can add a reference to the following assemblies:
- Telerik.Licensing.Runtime
- Telerik.Windows.Controls
You can find the required assemblies for each control from the suite in the Controls Dependencies help article.
First, we can create the UI of the gallery (Example 1). We will use one panel to hold several Image elements that will represent the gallery with the small images (the thumbnails). Then we can add another panel that will display the selected image.
Example 1: Defining the UI of the TouchManager example
Here is an image that demonstrates the view:
Let us start by implementing the swipe of the gallery items. We can do that by handling the swipe and swipe inertia events of TouchManager. Example 2 demonstrates how to subscribe to the events:
Example 2: Subscribing to TouchManager events
The logic for the swipe action will be implemented in the Swipe and SwipeInertia event handlers. We can place the implementation in a separate method and use it in the handlers.
Example 3: Event handlers implementation
Although we are working directly only with the Swipe and SwipeInertia events, we are going to handle the related events for consistency - SwipeStarted, SwipeFinisihed, SwipeInertiaStarted and SwipeInertiaFinished.
Example 4: Event handlers implementation
The SwipeInertia event won't be fired unless the SwipeInertiaStarted is handled.
args.Handled=true
Now when you swipe horizontally through the gallery, the images will scroll.
Telerik UI for WPF Learning Resources
- Telerik UI for WPF TouchManager Component
- Getting Started with Telerik UI for WPF Components
- Telerik UI for WPF Installation
- Telerik UI for WPF and WinForms Integration
- Telerik UI for WPF Visual Studio Templates
- Setting a Theme with Telerik UI for WPF
- Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)
- Telerik UI for WPF License Agreement