1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Windows;
- using System.Windows.Controls;
- namespace Aitex.Sorter.UI.Controls.Common
- {
- /// <summary>
- /// LED.xaml 的交互逻辑
- /// </summary>
- public partial class LED : UserControl
- {
- public LED()
- {
- InitializeComponent();
- root.DataContext = this;
- }
- public bool On
- {
- get { return (bool)GetValue(OnProperty); }
- set { SetValue(OnProperty, value); }
- }
- // Using a DependencyProperty as the backing store for On. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty OnProperty =
- DependencyProperty.Register("On", typeof(bool), typeof(LED), new PropertyMetadata(false));
- public bool IsRed
- {
- get { return (bool)GetValue(IsRedProperty); }
- set { SetValue(IsRedProperty, value); }
- }
- // Using a DependencyProperty as the backing store for IsRed. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty IsRedProperty =
- DependencyProperty.Register("IsRed", typeof(bool), typeof(LED), new PropertyMetadata(false));
- }
- }
|