Hi Rodney,
When using the SlideView this way you're in an "unbound" operational mode and cannot access items across the views due to the visual tree and the BindingContext. This mode is appropriate for static content, like a set of "Welcome the app" getting started slides.
If you want data binding capabilities, you'll want to switch to using the control in data bound mode. This will give you the ability to bind to element in the slides while still reusing the content you've put in the ContentViews. The whole concept behind an Items DataTemplate is to reuse a set of UI controls many times. You can even bind to elements in the DataTemplate from the same page (including x:Reference).
Demo
I've updated my demo to show the control using ItemTemplate instead of direct content, find the page and models attached. Let me walk you through the key concepts.
The DataTemplate
This is what replaces the ContentView you were using. Take the content that is inside your ContentViews and and put it into a DataTemplate.
Here's my example, with an additional label to bind to and display an ID property:
You set this DataTemplate as the SlideView's ItemTemplate:
The ItemsSource
Next we set the SlideView's ItemsSource. Every item in the items source will get one instance of the DataTemplate. In my example, I've created a model for the items that will be used as the BindingContext of each DataTemplate:
Here's the model definition (
remember that SelectedPickerIndex needs to have property changes wired up)
You can expand the MySlideViewItem model to best suit your needs, but this example's properties doe the following:
- Hold a value for ID
- Hold a list of items for the Picker
- Hold a value of what is selected in the Picker.
Bonus: Querying Selections in the Slides
If you ever wanted to access any of the values that were selected in any of the slides, you only need to look in the collection. For example, let's say I wanted to know what was selected in the Slide with ID=2
Further Assistance
I hope this helps clarify the difference and provide a way forward. If you have any trouble,
please open a Support Ticket and attach the code you're using so that I can investigate and help directly.
It will be very helpful to have all of the items you're using (view, model, viewmodel) so I can provide a more relevant demo that fits your actual implementation.
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items