Can't use SlideView to scroll custom controls?

4 posts, 0 answers
  1. Senkwe
    Senkwe avatar
    6 posts
    Member since:
    Sep 2013

    Posted 02 Oct 2013 Link to this post

    Is there any reason why I can't do something like this...


    <telerik:RadSlideView ItemsSource="{Binding SettingsControls}" AdjacentItemsPreviewMode="Both" Grid.Row="1" Grid.ColumnSpan="2" CacheMode="BitmapCache" IsLoopingEnabled="True">

                <telerik:RadSlideView.ItemTemplate>
                    <DataTemplate>
                        <ContentPresenter Content="{Binding}"/>                    
                    </DataTemplate>
                </telerik:RadSlideView.ItemTemplate>
            </telerik:RadSlideView>

    Where SettingsControls is a collection of Control.
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 03 Oct 2013 Link to this post

    Hi Senkwe,

    Thanks for writing.

    The reason for this not being possible is the fact that almost all item controls on Windows Phone (native and third-party) implement a special UI virtualization mechanisms which reuse visual containers while scrolling/swiping between items. That said, if the content within your source is any visual element, you will get exceptions since Silverlight does not allow inserting a single visual element in two different parent collections which will actually happen if the elements within you source inherit from UIElement.

    The standard approach of visualizing any data is defining a special Data Template that actually would have the structure of your Control and binding the properties within this template to a propery on your business object which should be part of the source.

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Senkwe
    Senkwe avatar
    6 posts
    Member since:
    Sep 2013

    Posted 04 Oct 2013 Link to this post

    I see. Well that's pretty unfortunate then.

    Your proposed solution won't work for me because I wanted to use the slide view as the container for some small settings screens/forms. ie, the controls are not of the same type.

    Guess I'll have to roll my own, which is disappointing.
  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 09 Oct 2013 Link to this post

    Hello Senkwe,

    If you want to have different views for the different items, you can use RadSlideView's ItemTemplateSelector and define different templates for the different types of data. Another possibility would be to use native controls like Panorama or Pivot.

    I hope this information helps.

    Regards,
    Todor
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner