月更
This commit is contained in:
50
NeuWPF/NeuWPFTest/ControlTestWindow.xaml.cs
Normal file
50
NeuWPF/NeuWPFTest/ControlTestWindow.xaml.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
|
||||
namespace NeuWPFTest
|
||||
{
|
||||
/// <summary>
|
||||
/// ControlTestWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ControlTestWindow : Window
|
||||
{
|
||||
public ControlTestWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetViewData();
|
||||
SetItemsData();
|
||||
}
|
||||
private void SetViewData()
|
||||
{
|
||||
var i1 = new TreeData("1111");
|
||||
i1.Children = new List<TreeData>
|
||||
{
|
||||
new TreeData("AAA"),
|
||||
new TreeData("BBB")
|
||||
};
|
||||
List<TreeData> datalist = new()
|
||||
{
|
||||
i1,
|
||||
new TreeData("2222"),
|
||||
new TreeData("3333")
|
||||
};
|
||||
|
||||
myTreeView.ItemsSource = datalist;
|
||||
OldTreeView.ItemsSource = datalist;
|
||||
}
|
||||
|
||||
private void SetItemsData()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public class TreeData
|
||||
{
|
||||
public TreeData(string name)
|
||||
{
|
||||
ItemName = name;
|
||||
}
|
||||
public string ItemName { get; set; }
|
||||
public List<TreeData> Children { get; set; } = new List<TreeData>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user