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

SlideView - Prameter incorect exception

1 Answer 58 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.
Attila
Top achievements
Rank 1
Attila asked on 26 Mar 2012, 11:43 AM
Hello,

I would like to use the SlideView control, but i think i have found a bug. If i define a DataTemplate which has a UserControl I got this exception: "The parameter is incorrect." (attached)
This exception only occured, when the second usercontrol was moved to the top.

PS: If i use image in the datatemplate everything is fine. This "bug" (maybe not) only occures when i use usercontrol in the datatemplate.

DataTemplate (attached)

Greetings,
Attila

1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 26 Mar 2012, 01:38 PM
Hi Attila,

Thank you for contacting us. I assume you have an MVVM scenario and your ViewModel (a.k.a. business object) is a UIElement, since you are passing it as content to a UserControl (notice that the Content property is of type UIElement).

<DataTemplate>
    <UserControl Content="{Binding}" />
</DataTemplate>

Such approach is not recommended and is often considered as bad practice in MVVM scenarios.
The rule of thumb is that your ViewModel should be a simple object comprised of properties which are NOT UIElements. 

For more information on how to use RadSlideView properly, please refer to its documentation. In addition, I've attached a sample project demostrating RadSlideView's usage in MVVM scenario.

Don't hesitate to contact us if you have further question or comments.

Greetings,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
SlideView
Asked by
Attila
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or