using System.Windows; using System.Windows.Controls; using System.Windows.Media; using Venus_Themes.Unity; namespace Venus_Themes.UserControls { /// /// StateTitle.xaml 的交互逻辑 /// 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 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 }); } } }