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

How to RadTreeView events work with MVVM

5 Answers 194 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yang
Top achievements
Rank 1
Yang asked on 01 Oct 2010, 04:39 AM
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.

5 Answers, 1 is accepted

Sort by
0
Yang
Top achievements
Rank 1
answered on 01 Oct 2010, 03:27 PM
I think I know the answer. Use Blend EventTriggers.
0
Zarko
Telerik team
answered on 05 Oct 2010, 02:53 PM
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
0
Michael Schreiber
Top achievements
Rank 1
answered on 15 Oct 2010, 07:51 PM
Is there a way todo it without Expressions? 
0
Hristo
Telerik team
answered on 20 Oct 2010, 03:39 PM
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
0
Rodd
Top achievements
Rank 1
answered on 30 Dec 2010, 07:01 PM
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.
Tags
TreeView
Asked by
Yang
Top achievements
Rank 1
Answers by
Yang
Top achievements
Rank 1
Zarko
Telerik team
Michael Schreiber
Top achievements
Rank 1
Hristo
Telerik team
Rodd
Top achievements
Rank 1
Share this question
or