MutilTreeView.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. namespace Muchinfo.WPF.Controls.MutilComboBox
  15. {
  16. /// <summary>
  17. /// 按照步骤 1a 或 1b 操作,然后执行步骤 2 以在 XAML 文件中使用此自定义控件。
  18. ///
  19. /// 步骤 1a) 在当前项目中存在的 XAML 文件中使用该自定义控件。
  20. /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根
  21. /// 元素中:
  22. ///
  23. /// xmlns:MyNamespace="clr-namespace:Muchinfo.WPF.Controls.MutilComboBox"
  24. ///
  25. ///
  26. /// 步骤 1b) 在其他项目中存在的 XAML 文件中使用该自定义控件。
  27. /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根
  28. /// 元素中:
  29. ///
  30. /// xmlns:MyNamespace="clr-namespace:Muchinfo.WPF.Controls.MutilComboBox;assembly=Muchinfo.WPF.Controls.MutilComboBox"
  31. ///
  32. /// 您还需要添加一个从 XAML 文件所在的项目到此项目的项目引用,
  33. /// 并重新生成以避免编译错误:
  34. ///
  35. /// 在解决方案资源管理器中右击目标项目,然后依次单击
  36. /// “添加引用”->“项目”->[浏览查找并选择此项目]
  37. ///
  38. ///
  39. /// 步骤 2)
  40. /// 继续操作并在 XAML 文件中使用控件。
  41. ///
  42. /// <MyNamespace:MutilTreeView/>
  43. ///
  44. /// </summary>
  45. public class MutilTreeView : Control
  46. {
  47. static MutilTreeView()
  48. {
  49. DefaultStyleKeyProperty.OverrideMetadata(typeof(MutilTreeView), new FrameworkPropertyMetadata(typeof(MutilTreeView)));
  50. }
  51. }
  52. }