ItemTemplateSelector
RadSlideView control exposes an ItemTemplateSelector property which you can use to apply different template to each item depending on a specific condition.
This article will show you how you can utilize this property to achieve divergent appearance for the different items within your Telerik SlideView control.
TemplateSelector Implementation
Let's assume you have a RadSlideView bound to a collection of multiple Product objects and the appearance of each item depends on a specific property of the business object.
Add the following ViewModel class:
Then, as you need to apply different template to the item based on the value of the InStock property, you have to create a custom class that inherits from DataTemplateSelector. This class will return different DataTemplate according to whether the value is true or false:
The next step is to define the needed templates inside the Resources of your page:
Declare a simple SlideView and set its ItemsSource and ItemTemplateSelector properties:
All that is left is to set the BindingContext to the ViewModel:
Here is how RadSlideView looks with both templates applied: