StateTitle.xaml.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Media;
  4. using Venus_Themes.Unity;
  5. namespace Venus_Themes.UserControls
  6. {
  7. /// <summary>
  8. /// StateTitle.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class StateTitle : UserControl
  11. {
  12. public StateTitle()
  13. {
  14. InitializeComponent();
  15. }
  16. public static readonly DependencyProperty LabelColorProperty = DependencyProperty.Register(
  17. "LabelColor", typeof(SolidColorBrush), typeof(StateTitle), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#838B83"))));
  18. public SolidColorBrush LabelColor
  19. {
  20. get { return (SolidColorBrush)this.GetValue(LabelColorProperty); }
  21. set { this.SetValue(LabelColorProperty, value); }
  22. }
  23. public static readonly DependencyProperty TextBoxColorProperty = DependencyProperty.Register(
  24. "TextBoxColor", typeof(SolidColorBrush), typeof(StateTitle));
  25. public SolidColorBrush TextBoxColor
  26. {
  27. get { return (SolidColorBrush)this.GetValue(TextBoxColorProperty); }
  28. set { this.SetValue(TextBoxColorProperty, value); }
  29. }
  30. public static readonly DependencyProperty TextBoxValueProperty = DependencyProperty.Register(
  31. "TextBoxValue", typeof(string), typeof(StateTitle));
  32. public string TextBoxValue
  33. {
  34. get { return (string)this.GetValue(TextBoxValueProperty); }
  35. set { this.SetValue(TextBoxValueProperty, value); }
  36. }
  37. public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
  38. "Title", typeof(string), typeof(StateTitle));
  39. public string Title
  40. {
  41. get { return (string)this.GetValue(TitleProperty); }
  42. set { this.SetValue(TitleProperty, value); }
  43. }
  44. public static readonly DependencyProperty IsIncludeProperty = DependencyProperty.Register(
  45. "IsInclude", typeof(bool), typeof(StateTitle));
  46. public bool IsInclude
  47. {
  48. get
  49. {
  50. return (bool)this.GetValue(IsIncludeProperty);
  51. }
  52. set
  53. {
  54. this.SetValue(IsIncludeProperty, value);
  55. }
  56. }
  57. public static readonly DependencyProperty IsNeedIncludeProperty = DependencyProperty.Register(
  58. "IsNeedInclude", typeof(bool), typeof(StateTitle),new PropertyMetadata(true));
  59. public bool IsNeedInclude
  60. {
  61. get
  62. {
  63. return (bool)this.GetValue(IsNeedIncludeProperty);
  64. }
  65. set
  66. {
  67. this.SetValue(IsNeedIncludeProperty, value);
  68. }
  69. }
  70. public static readonly DependencyProperty IsNeedContextMenuProperty = DependencyProperty.Register(
  71. "IsNeedContextMenu", typeof(bool), typeof(StateTitle), new PropertyMetadata(true));
  72. public bool IsNeedContextMenu
  73. {
  74. get
  75. {
  76. return (bool)this.GetValue(IsNeedContextMenuProperty);
  77. }
  78. set
  79. {
  80. this.SetValue(IsNeedContextMenuProperty, value);
  81. }
  82. }
  83. public static readonly DependencyProperty IsOnlineProperty = DependencyProperty.Register(
  84. "IsOnline", typeof(bool), typeof(StateTitle));
  85. public bool IsOnline
  86. {
  87. get
  88. {
  89. return (bool)this.GetValue(IsOnlineProperty);
  90. }
  91. set
  92. {
  93. this.SetValue(IsOnlineProperty, value);
  94. }
  95. }
  96. private void Initialize_Click(object sender, RoutedEventArgs e)
  97. {
  98. UIEvents.OnInitRaiseChanged(Title);
  99. }
  100. private void Abort_Click(object sender, RoutedEventArgs e)
  101. {
  102. UIEvents.OnAbortRaiseChanged(Title);
  103. }
  104. private void Exclude_Click(object sender, RoutedEventArgs e)
  105. {
  106. UIEvents.OnIncludeRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = false });
  107. }
  108. private void Include_Click(object sender, RoutedEventArgs e)
  109. {
  110. UIEvents.OnIncludeRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = true });
  111. }
  112. private void Online_Click(object sender, RoutedEventArgs e)
  113. {
  114. UIEvents.OnOnlineRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = true});
  115. }
  116. private void Offline_Click(object sender, RoutedEventArgs e)
  117. {
  118. UIEvents.OnOnlineRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = false });
  119. }
  120. }
  121. }