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

MVVM and PanelBar

1 Answer 85 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Damon
Top achievements
Rank 1
Damon asked on 18 Aug 2009, 05:13 PM
I have a panel bar and I am using the hierarchialdatatemplate.  I am also using an MVVM pattern.  My question is how can I set the IsSelected flag on my ViewModel with a setter property and/or trigger on mouse over so that I know which item in the panel bar is currently selected during a context menu action.  I have this working on a listview, but I cannot get it to work with the panelbar.  Any help or example would be greatly appreciated.

Thanks

Damon

1 Answer, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 19 Aug 2009, 03:23 PM
Hello Damon,

What you can do, if I understand you correctly, is use the VisualTreeHelper.FindElementsInHostCoordinates() method when the context menu is displayed. The method returns a collection of visual elements that are rendered under the mouse cursor. You can search this collection for PanelBarItem objects and if there is one, it should be the one you are looking for. Let me know if this helps.

Greetings,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
PanelBar
Asked by
Damon
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or