| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 | using System.Windows;using System.Windows.Controls;using System.Windows.Media;using Venus_Themes.Unity;namespace Venus_Themes.UserControls{    /// <summary>    /// StateTitle.xaml 的交互逻辑    /// </summary>    public partial class StateTitle : UserControl    {        public StateTitle()        {            InitializeComponent();        }        public static readonly DependencyProperty LabelColorProperty = DependencyProperty.Register(     "LabelColor", typeof(SolidColorBrush), typeof(StateTitle), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#838B83"))));        public SolidColorBrush LabelColor        {            get { return (SolidColorBrush)this.GetValue(LabelColorProperty); }            set { this.SetValue(LabelColorProperty, value); }        }        public static readonly DependencyProperty TextBoxColorProperty = DependencyProperty.Register(     "TextBoxColor", typeof(SolidColorBrush), typeof(StateTitle));        public SolidColorBrush TextBoxColor        {            get { return (SolidColorBrush)this.GetValue(TextBoxColorProperty); }            set { this.SetValue(TextBoxColorProperty, value); }        }        public static readonly DependencyProperty TextBoxValueProperty = DependencyProperty.Register(    "TextBoxValue", typeof(string), typeof(StateTitle));        public string TextBoxValue        {            get { return (string)this.GetValue(TextBoxValueProperty); }            set { this.SetValue(TextBoxValueProperty, value); }        }        public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(   "Title", typeof(string), typeof(StateTitle));        public string Title        {            get { return (string)this.GetValue(TitleProperty); }            set { this.SetValue(TitleProperty, value); }        }        public static readonly DependencyProperty IsIncludeProperty = DependencyProperty.Register(         "IsInclude", typeof(bool), typeof(StateTitle));        public bool IsInclude        {            get            {                return (bool)this.GetValue(IsIncludeProperty);            }            set            {                this.SetValue(IsIncludeProperty, value);            }        }        public static readonly DependencyProperty IsNeedIncludeProperty = DependencyProperty.Register(         "IsNeedInclude", typeof(bool), typeof(StateTitle),new PropertyMetadata(true));        public bool IsNeedInclude        {            get            {                return (bool)this.GetValue(IsNeedIncludeProperty);            }            set            {                this.SetValue(IsNeedIncludeProperty, value);            }        }        public static readonly DependencyProperty IsNeedContextMenuProperty = DependencyProperty.Register(         "IsNeedContextMenu", typeof(bool), typeof(StateTitle), new PropertyMetadata(true));        public bool IsNeedContextMenu        {            get            {                return (bool)this.GetValue(IsNeedContextMenuProperty);            }            set            {                this.SetValue(IsNeedContextMenuProperty, value);            }        }        public static readonly DependencyProperty IsOnlineProperty = DependencyProperty.Register(        "IsOnline", typeof(bool), typeof(StateTitle));        public bool IsOnline        {            get            {                return (bool)this.GetValue(IsOnlineProperty);            }            set            {                this.SetValue(IsOnlineProperty, value);            }        }        private void Initialize_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnInitRaiseChanged(Title);        }        private void Abort_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnAbortRaiseChanged(Title);        }        private void Exclude_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnIncludeRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = false });        }        private void Include_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnIncludeRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = true });        }        private void Online_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnOnlineRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = true});        }        private void Offline_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnOnlineRaiseChanged(new IncludePara() { ModuleName = Title, IsInclude = false });        }    }}
 |