• 大小: 162KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-27
  • 语言: C#
  • 标签: WPF  TreeView  数据绑定  

资源简介

WPF的TreeView不像WinForms的TreeView那样,通过TreeNode实现树型节点。WPF的TreeView实现起来,我感觉有点像VM(View-Model)模式,就像WinForms中的DataGrid,控件负责显示,数据在DataTable中。那么我们在实现TreeView时,也需要用这样的思路,数据在Model中,控件是View负责显示。 我需要实现的最终目标是: 1.节点是异步加载的(解决效率问题) 2.节点是无限级别的(递归的,这样可复用与目录结构、组织架构等数据类型) 3.节点是可以多选的(用CheckBox选择) 4.XAML方式绑定(减少UI上Code量) 5.方便得获取选中项信息

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace DepartmentTreeView {
    /// 
    /// App.xaml 的交互逻辑
    /// 

    public partial class App : Application {
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        439  2011-05-05 11:49  DepartmentTreeView\app.config

     文件        329  2011-05-05 11:44  DepartmentTreeView\App.xaml

     文件        308  2011-05-05 11:44  DepartmentTreeView\App.xaml.cs

     文件     221184  2011-05-05 14:53  DepartmentTreeView\bin\Debug\DB\Sample.mdb

     文件      45056  2011-05-06 10:47  DepartmentTreeView\bin\Debug\DepartmentTreeView.exe

     文件        439  2011-05-05 11:49  DepartmentTreeView\bin\Debug\DepartmentTreeView.exe.config

     文件     105984  2011-05-06 10:47  DepartmentTreeView\bin\Debug\DepartmentTreeView.pdb

     文件      11600  2011-05-06 10:51  DepartmentTreeView\bin\Debug\DepartmentTreeView.vshost.exe

     文件        439  2011-05-05 11:49  DepartmentTreeView\bin\Debug\DepartmentTreeView.vshost.exe.config

     文件        490  2010-03-17 22:39  DepartmentTreeView\bin\Debug\DepartmentTreeView.vshost.exe.manifest

     文件        863  2011-05-05 13:18  DepartmentTreeView\DB\DepartmentHelper.cs

     文件     241664  2011-05-06 11:07  DepartmentTreeView\DB\Sample.mdb

     文件      83448  2011-05-06 11:07  DepartmentTreeView\DB\SampleDataSet.Designer.cs

     文件          3  2011-05-06 11:07  DepartmentTreeView\DB\SampleDataSet.xsc

     文件      10440  2011-05-06 11:07  DepartmentTreeView\DB\SampleDataSet.xsd

     文件          3  2011-05-06 11:07  DepartmentTreeView\DB\SampleDataSet.xss

     文件       5217  2011-05-05 13:24  DepartmentTreeView\DepartmentTreeView.csproj

     文件        227  2011-05-05 13:12  DepartmentTreeView\DepartmentTreeView.csproj.user

     文件        877  2011-05-05 11:44  DepartmentTreeView\DepartmentTreeView.sln

    ..A..H.     30208  2011-05-06 11:07  DepartmentTreeView\DepartmentTreeView.suo

     文件       6108  2011-05-06 10:43  DepartmentTreeView\DepartmentViewModel.cs

     文件       2113  2011-05-06 10:38  DepartmentTreeView\MainWindow.xaml

     文件       1561  2011-05-06 10:43  DepartmentTreeView\MainWindow.xaml.cs

     文件       2237  2011-05-06 10:33  DepartmentTreeView\obj\x86\Debug\App.g.cs

     文件       2237  2011-05-06 10:33  DepartmentTreeView\obj\x86\Debug\App.g.i.cs

     文件       1788  2011-05-06 10:51  DepartmentTreeView\obj\x86\Debug\DepartmentTreeView.csproj.FileListAbsolute.txt

     文件      45056  2011-05-06 10:47  DepartmentTreeView\obj\x86\Debug\DepartmentTreeView.exe

     文件       2459  2011-05-06 10:47  DepartmentTreeView\obj\x86\Debug\DepartmentTreeView.g.resources

     文件     105984  2011-05-06 10:47  DepartmentTreeView\obj\x86\Debug\DepartmentTreeView.pdb

     文件        180  2011-05-06 10:33  DepartmentTreeView\obj\x86\Debug\DepartmentTreeView.Properties.Resources.resources

............此处省略36个文件信息

评论

共有 条评论