Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Use the example:DirTree.CS to customize the control (Read 9252 times)
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Use the example:DirTree.CS to customize the control
Nov 17th, 2020 at 10:20am
Print Post  
Hello, all! Smiley

In order to understand the implementation mechanism of example: DirTree.CS, I wrote a very simple project: WpfTreeView. But for the current understanding of WPF is not deep enough to realize a function block that I need in another big project, so I decided to use DirTree.CS as an example to modify to complete the function block of my big project. Of course, your help is indispensable here. Any help you give to my project is a precious thing to me.

For the use of DirTree.CS as an example to implement the functional blocks of my project, I have summarized the following questions:
« Last Edit: Nov 17th, 2020 at 12:11pm by JackPan »  

11_17_1.png (Attachment deleted)
11_17_2.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #1 - Nov 17th, 2020 at 10:25am
Print Post  
Question 1.I want to change DirTree.CS to UserControl to place it in the Grid position specified in the figure.
How to achieve it? Smiley
  

11_17_0.png (Attachment deleted)
11_17_16.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #2 - Nov 17th, 2020 at 10:49am
Print Post  
My simple project is implemented with TreeView, as shown in Figure 11_17_1.png and 11_17_2.png. Because this simple project exceeds 300kb, I cannot upload it here. I have to use pictures to express it.
Question 2:I need to explain that two different TreeViews can be switched and displayed in the same Grid position.
    As shown in the screenshot 11_17_3.png: This is TreeView1. Once the program is started, it will initialize and display a top item: Top and six SubItems: Mark, Resistor, Capacitor, Diode, Transistor, IC.
    As shown in the screenshot 11_17_10.png: This is TreeView2.There are no items in this TreeView2.
How to achieve it? Smiley
  

11_17_3.png (Attachment deleted)
11_17_10.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #3 - Nov 17th, 2020 at 11:07am
Print Post  
Question 3:The right-click menu of any item in TreeView1 contains the possibility to add a SubItem or add an Item of the same level.
How to achieve it? Smiley
  

11_17_11.png (Attachment deleted)
11_17_12.png (Attachment deleted)
11_17_13.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #4 - Nov 17th, 2020 at 11:36am
Print Post  
    The TreeView1 can not only add a new Item or SubItem to the selected Item or SubItem through the right-click menu, but also add the corresponding item or sub-item of TreeView1 by clicking the item in the custom ComboBox, as shown in the screenshot 11_17_14 and the screenshot 11_17_15.
    Question 4:How to realize the custom ComboBox style in screenshot 11_17_14? Any assistance from you will be greatly appreciated. Smiley
    Question 5:How can I click the item of this custom ComboBox to add the corresponding Item of this TreeView1? Smiley
  

11_17_14.png (Attachment deleted)
11_17_15.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #5 - Nov 17th, 2020 at 11:43am
Print Post  
Question 6:When Double-Clicking any of Item in TreeView1 will display the TreeView2 in the same Grid position and the TreeView2 will diasplay all SubItems of the selected Item of the TreeView1.
How to achieve it? Smiley
  

11_17_4.png (Attachment deleted)
11_17_5.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #6 - Nov 17th, 2020 at 11:50am
Print Post  
    Question 7:The HeaderTemplate of the TreeView1 contains 4 <Image>, the first on the left is the function to display all items, the second, third, and fourth functions on the left are to filter all items in a specific way, and then display the filtered items come out.
    How to achieve it? Smiley
  

11_17_6.png (Attachment deleted)
11_17_7.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree to customize the control
Reply #7 - Nov 17th, 2020 at 11:52am
Print Post  
    Question 8:The HeaderTemplate of The TreeView2 contains 6 <Image>. The first red arrow on the left is to return to display the TreeView1. The function of the second black arrow on the left is to display all SubItems of the previous Item of the current Item of the TreeView1 in the TreeView2. The function of the third black arrow on the left is to display all SubItems of the next Item of the current Item of the TreeView1 in the TreeView2. The three arrows behind are the same as those of the TreeView1
Filter all items in a specific way, and then display the filtered items out.
    How to achieve it? Smiley
  

11_17_8.png (Attachment deleted)
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree.CS to customize the control
Reply #8 - Nov 18th, 2020 at 2:58am
Print Post  
    Please guide me, any assistance is greatly appreciated.

    Send you the most sincere blessings.

    Jack Smiley
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Use the example:DirTree.CS to customize the control
Reply #9 - Nov 18th, 2020 at 6:33am
Print Post  
That's great enthusiasm from you to use our diagram for everything in your life, but there's no point creating a treeview user control through diagram when WPF already comes with a perfectly fine dedicated control. E.g. see tuturial at https://www.c-sharpcorner.com/UploadFile/mahesh/treeview-in-wpf/ for styling TreeView etc.

You could place several TreeViews in a TabControl, or switch a single TreeView's data from ToolBar button clicks to implement your header UI.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Use the example:DirTree.CS to customize the control
Reply #10 - Nov 18th, 2020 at 7:00am
Print Post  
With WPF's TreeView you should be able to expand or collapse branches from code by setting TreeViewItem.IsExpanded.

You can add child items as in https://stackoverflow.com/questions/30953599/how-to-insert-a-child-item-in-a-tre...

You can show context menu as in https://stackoverflow.com/questions/13420994/how-to-display-context-menu-for-tre...

If you really prefer using the diagram, see the TreeLayout sample project for adding child items from context menu.
  
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree.CS to customize the control
Reply #11 - Nov 18th, 2020 at 1:22pm
Print Post  
    Thank you very much.

    I understand the example in this https://www.c-sharpcorner.com/UploadFile/mahesh/treeview-in-wpf/ link. But https://stackoverflow.com/questions/13420994/how-to-display-context-menu-for-tre
..., https://stackoverflow.com/questions/30953599/how-to-insert-a- child-item-in-a-tre...
There are some parts in these two examples that I don't understand very well, such as the meaning of context menu, but it doesn't matter, I will continue to understand.

    I would like to ask how the custom ComboBox style in the screenshot 11_17_14.png is realized? and add the corresponding item or sub-item of TreeView1 by clicking the item in the custom ComboBox. I tried to nest a TreeView or DataGrid in the ComboBox. But I feel that the effects are different.

    Any assistance from you is greatly appreciated.
   
    Send you the most sincere blessings.

    Jack. Smiley
  

11_17_14_001.png (Attachment deleted)
11_17_15_001.png (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Use the example:DirTree.CS to customize the control
Reply #12 - Nov 19th, 2020 at 7:15am
Print Post  
  
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Use the example:DirTree.CS to customize the control
Reply #13 - Nov 19th, 2020 at 8:57am
Print Post  
    Thank you very much.
   
    I have tried the examples in the link, and there are some errors in them, but I don't know how to troubleshoot. I kindly ask you to write an example for me in combination with all the questions I raised above. Although I know this is just WPF knowledge, I really want to implement it quickly and work with MindFusion WPF Pack.

    Best wishes for you.

    Jack. Smiley
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Use the example:DirTree.CS to customize the control
Reply #14 - Nov 19th, 2020 at 12:10pm
Print Post  
Well now, we don't owe you spending days writing your application UI and business logic for you. This forum is for specific questions on MindFusion's products - let us know if you have any.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint