MarkTreeItemsControlUserControl.xaml.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using ivf_tl_Entity.Entity.Mark;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace ivf_tl_Manage.UserControls
  18. {
  19. /// <summary>
  20. /// MarkTreeItemsControlUserControl.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class MarkTreeItemsControlUserControl : UserControl
  23. {
  24. public event Func<MarkEntity, string, bool> MarkOperEvent;
  25. public MarkTreeItemsControlUserControl()
  26. {
  27. InitializeComponent();
  28. }
  29. public ObservableCollection<MarkEntity> DetailItemSouce
  30. {
  31. get { return (ObservableCollection<MarkEntity>)GetValue(DetailItemSouceProperty); }
  32. set { SetValue(DetailItemSouceProperty, value); }
  33. }
  34. // Using a DependencyProperty as the backing store for DetailItemSouce. This enables animation, styling, binding, etc...
  35. public static readonly DependencyProperty DetailItemSouceProperty =
  36. DependencyProperty.Register("DetailItemSouce", typeof(ObservableCollection<MarkEntity>), typeof(MarkTreeItemsControlUserControl), new PropertyMetadata(null));
  37. public Brush RectangleFill
  38. {
  39. get { return (Brush)GetValue(RectangleFillProperty); }
  40. set { SetValue(RectangleFillProperty, value); }
  41. }
  42. // Using a DependencyProperty as the backing store for RectangleFill. This enables animation, styling, binding, etc...
  43. public static readonly DependencyProperty RectangleFillProperty =
  44. DependencyProperty.Register("RectangleFill", typeof(Brush), typeof(MarkTreeItemsControlUserControl), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#EAEAEA"))));
  45. private bool MarkTreeUserControl_MarkOperEvent(MarkEntity arg1, string arg2)
  46. {
  47. if (MarkOperEvent?.Invoke(arg1, arg2) == true) return true;
  48. return false;
  49. }
  50. }
  51. }