Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WPF MVVM
I have used a extened treeview control with selecteditem dependency property in my view. I am binding the treeview data from the viewmodel list property. Now when the user selects an item in the extended treeview I am able to view the selected item in the dependency property class.
But I want to access this property in my view's view model to work on it.
If anyone have idea to solve this please reply me.
Thanks in advance.
Posted 18-Dec-12 2:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I recently posted a possible (and working) answer to a post similar to this.
Because the WPF TreeView does not support this, my answer is to make an easy solution to create an extension of the TreeView and expose the DependencyProprty there.
wpf mvvm treeview get selected item
Hope it helps!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Dnyaneshwar@Pune 719
1 CHill60 315
2 Sergey Alexandrovich Kryukov 240
3 TheRealSteveJudge 190
4 Peter Leow 160
0 Sergey Alexandrovich Kryukov 9,193
1 OriginalGriff 6,786
2 Peter Leow 4,332
3 Zoltán Zörgő 3,809
4 Richard MacCutchan 2,672

Advertise | Privacy | Mobile
Web03 | 2.8.150128.1 | Last Updated 23 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100