This is a getting started question about how to create a reusable wpf slideshow control:
- that displays a sequence of any visualizable elements e.g. a series of Image controls or a series of UserControls (should I target
ContentControl, or is there a broader type that encompasses more visualizables/controls?) - the control should be able to accept an
IListof some kind, which would be the elements/slides to present - the control should expose an Interval property that determines the duration of each slide, but i dont even know the basics of how to get started with that in terms of offering that property to be configured in xaml?
- and what should the container be, if any, for the individual slides/controls that are passed in?
To start with, you should probably create a
UserControlwhich contains anImagecontrol, and perhaps Next/PreviousButtons, and anything else you may need. These would all be laid out as normal using a variety of panels, you could probably style most of it with just a Grid.After that, your
UserControlwill implement theImageSource(yourIList, orIEnumerableof images), and your interval as dependency properties. These are then settable in XAML.You would then write the logic which loads the next image and sets it as the Image’s
Sourceproperty, this could happen in the change event for theImageSourceproperty. You can then get as advanced as you wish with Image preloading/caching etc.