I'm trying to use the TreeViewItem in a RadOutlookBar to provide a navigation system for my app.
I'm trying to use Commands in a MVVM pattern to launch the views...
TreeViewItem lacks a Command property.. is there a way to do this?
2 Answers, 1 is accepted
answered on 26 Feb 2010, 12:36 PM
Hello Scott Taylor,
We replay to your support ticket. I'm pasting this to allow others to it,a s well.
The TreeViewItems indeed do not have built-in support for commands.
If you are binding the TreeView you can use an ItemTemplate that contains buttons which have their command property set.
If the TreeView is defined in Xaml you can assign the Header property of the TreeViewItem some kind of content that contains a button.
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?
Telerik Public Issue Tracking
system and vote to affect the priority of the items.
From that code, pull out the NSVMVVM assembly. This assembly is mostly code from Sacha Barbers Cinch framework. However, the code I use in it to implement commanding in elements that don't support it natively, I pulled from Jeff Brands training series.
Please check out CompositeDevPatterns.com. I consulted with a couple of persons from Telerik and we thought it would be a good idea to have a central place to discuss MVVM, Prism etc. The site is just being started so if you check it out and have any suggestions about the layout. Have any thing you'd like to see a demo of, if I have time I'll consider adding it as a lesson.
P.S. A sample of xaml wiring up a custom command to a Non-command UI element would look somethng like this using the code in the link I sent you.