This is a migrated thread and some comments may be shown as answers.

Can't use SlideView to scroll custom controls?

3 Answers 48 Views
SlideView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Senkwe
Top achievements
Rank 1
Senkwe asked on 02 Oct 2013, 08:48 PM
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.

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 03 Oct 2013, 03:29 PM
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.
0
Senkwe
Top achievements
Rank 1
answered on 04 Oct 2013, 02:09 PM
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.
0
Todor
Telerik team
answered on 09 Oct 2013, 10:48 AM
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.
Tags
SlideView
Asked by
Senkwe
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Senkwe
Top achievements
Rank 1
Todor
Telerik team
Share this question
or