SlideView - Prameter incorect exception

2 posts, 1 answers
  1. Attila
    Attila avatar
    3 posts
    Member since:
    Jan 2012

    Posted 26 Mar 2012 Link to this post

    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
  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 26 Mar 2012 Link to this post

    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 >>
  3. DevCraft banner
Back to Top