I am currently working on a project that involves a multi-tree view selection in a MVVM,WPF application using C#. The tree view supports functionalities such as Cut, Copy, Move, and Paste between nodes. and support ,Expand, Collapse Here are some details of the project:
The tree view has a single root node that serves as the common root for the entire project.
The root node has permissions to add Node A or Node B.
Node A has permissions to add Node A or Node B.
Node B does not have permission to add any nodes.
I have implemented two interfaces, IWBSChild and IWBSParent, for the nodes. The DataContext is set in the code-behind of the MainWindow class.
However, I am encountering issues with binding. Specifically, I am unable to pass objects as intended to the AddCommand. I am unsure whether the problem lies in the binding process or if I am misunderstanding how the tree view operates.
For example:
When the selected object is the root node, there should be two context menu items for the user:
MenuItem 1: Header = “Create new Node A”
MenuItem 2: Header = “Create new Node B”
The AddCommand should execute correctly with the ViewModel corresponding to the selected object.
When the selected object is a Node A, there should be two context menu items for the user:
MenuItem 1: Header = “Create new Node A”
MenuItem 2: Header = “Create new Node B”
The AddCommand should execute correctly with the ViewModel corresponding to the selected object.
When the selected object is a Node B, there should be no Add functionality available.
my project source code here: https://github.com/NguyenVung2305/MultiTreeViewSelect.git.
I hope to get assistance or guidance on this master
get Exactly the way Binding on WPF
Nguyen Vung is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.