当前位置:网站首页>C WPF new open source control library: newbeecoder Nbtreeview of UI
C WPF new open source control library: newbeecoder Nbtreeview of UI
2022-06-23 20:55:00 【User 7152477】
The main function of the tree control is to display the collapsible node contents of the hierarchical structure , You can use... In the control ItemsSource As a data source .
There is an important attribute HierarchicalDataTemplate Object is used to set the hierarchical data template .
stay NbTreeView Control TreeViewItem Fill in content items , When setting IsExpanded The attribute is true Represents expansion , If you want to get the selected status, use IsSelected.
Newbeecoder.UI Open source controls Demo Download link :https://share.weiyun.com/P1ZABPUd
The control library develops the same... According to the product prototype diagram UI Interface , First video demo control library effect :
In the custom NbTreeView Add several attributes , Namely MaskBackground( Mask layer background color )、ShowIcon( Display the expansion icon )、ShowNoItemsIcon( No children , Whether to display the expansion icon )、IconWidth( Item left expand icon width )、ExpanderStyle( Expand style )、ExpandedIcon( Expand the icon ) etc. . You need to change the style by modifying the custom attributes .
Next, let's take a look at the tree control rendering :
The normal tree view calls the code :
<TextBlock Text=" Normal tree view " Margin="5"/>
<NbTreeView Style="{DynamicResource DefaultTreeViewStyle}" Margin="5" Width="150">
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" Option one " IsSelected="True">
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 1"/>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 2"/>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 3"/>
</NbTreeViewItem>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" Option 2 ">
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 1"/>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 2"/>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 3"/>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 4"/>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" children 5"/>
</NbTreeViewItem>
<NbTreeViewItem Style="{DynamicResource DefaultTreeViewItemStyle}" Header=" Option 2 "/>
</NbTreeView>File tree view calls code :
<TextBlock Text=" Document tree view " Margin="5"/>
<NbTreeView Style="{DynamicResource FolderTreeViewStyle}" Margin="5" Width="150">
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" Option one " IsSelected="True">
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 1"/>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 2"/>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 3"/>
</NbTreeViewItem>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" Option 2 ">
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 1"/>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 2"/>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 3"/>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 4"/>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" children 5"/>
</NbTreeViewItem>
<NbTreeViewItem Style="{DynamicResource FolderTreeViewItemStyle}" Header=" Option 2 "/>
</NbTreeView>边栏推荐
- 【Golang】快速复习指南QuickReview(七)——interface
- Script tag attributes and & lt; noscript&gt; label
- 3000 frame animation illustrating why MySQL needs binlog, redo log and undo log
- Digital procurement transformation solution: SaaS procurement management platform promotes enterprise sunshine procurement
- December 29, 2021: the elimination rules of a subsequence are as follows: 1. In a subsequence
- Row height, (top line, middle line, baseline, bottom line), vertical align
- Syntaxe des requêtes fédérées SQL (inline, left, right, full)
- Summary of multiple methods for obtaining the last element of JS array
- JS高级程序设计第 4 版:生成器的学习
- [golang] quick review guide quickreview (I) -- string
猜你喜欢

Importance and purpose of test

GL Studio 5 installation and experience

重庆 奉节耀奎塔,建成后当地连中五名进士,是川江航运的安全塔

Kubernetes resource topology aware scheduling optimization

小程序开发框架推荐
Implementing MySQL fuzzy search with node and express

Daily question brushing record (II)

Ugeek's theory 𞓜 application and design of observable hyperfusion storage system

Tupu software digital twin intelligent water service, breaking through the development dilemma of sponge City

Rstudio 1.4 software installation package and installation tutorial
随机推荐
Implementing MySQL fuzzy search with node and express
Development and code analysis of easycvr national standard user defined streaming address function
【Golang】快速复习指南QuickReview(一)——字符串string
Strokeit- the joy of one handed fishing you can't imagine
【Golang】在Go语言的角度重新审视闭包
QPS fails to go up due to frequency limitation of public network CLB bandwidth
手续费佣金低的券商,华泰证券网上开户安全吗
JS five methods to judge whether a certain value exists in an array
Postman tutorial - teach you API interface testing by hand
How to handle the prompt that DNS is incorrect when adding resolution to Tencent cloud?
CPS 22 January additional incentive rules
Kinsoku Jikou Desu Sina stock interface change
Install bitgarden open source password manager
教你如何用网页开发APP
What is the process of setting up local cloud on demand? Can cloud on demand audit videos?
How to build Tencent cloud game server? Differences between cloud game platforms and ordinary games
Dart series: your site is up to you. Use extension to extend classes
Tcp/udp Fundamentals
Yukeng MySQL service installation error
教你如何用网页开发桌面应用