How to RadTreeView events work with MVVM

6 posts, 0 answers
  1. Yang
    Yang avatar
    14 posts
    Member since:
    Jun 2009

    Posted 30 Sep 2010 Link to this post

    For example, how can I bind events LoadOnDemand, ItemPrepared and SelectionChanged with MVVM viewmodel? I want to remove all these events from code behind to viewmodel.
    Thanks.
  2. Yang
    Yang avatar
    14 posts
    Member since:
    Jun 2009

    Posted 01 Oct 2010 Link to this post

    I think I know the answer. Use Blend EventTriggers.
  3. DevCraft banner
  4. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 05 Oct 2010 Link to this post

    Hello Yang,

     You are right, the best way is to use blend EventTriggers. Please examine the attached project and if you have further questions feel free to ask.

    Regards,
    Zarko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Michael Schreiber
    Michael Schreiber avatar
    9 posts
    Member since:
    Mar 2004

    Posted 15 Oct 2010 Link to this post

    Is there a way todo it without Expressions? 
  6. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 20 Oct 2010 Link to this post

    Hello Michael Schreiber,

    You can try the RelayCommand functionality. Basically this "turns" the event handlers into "properties" you can bind to. Meaning that event handler implementation is moved to the view model and command you are binding to is a property. Telerik also provide it's own implementation of the those commands via the DelegateCommand class.

    Regards,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Rodd
    Rodd avatar
    7 posts
    Member since:
    Jul 2010

    Posted 30 Dec 2010 Link to this post

    Sorry, I had posted and then realized both the answer to my question and how ignorant my question was to begin with.  You can ignore this post.
Back to Top
DevCraft banner