using System.Windows; using System.Windows.Controls; using System.Windows.Media.Animation; using MECF.Framework.UI.Client.ClientBase; using OpenSEMI.ClientBase; namespace SicUI.Controls { /// /// WaferCtrl.xaml 的交互逻辑 /// public partial class WaferCtrl : UserControl { public WaferCtrl() { InitializeComponent(); } #region Dps #region WaferData public WaferInfo WaferData { get => (WaferInfo)GetValue(WaferDataProperty); set => SetValue(WaferDataProperty, value); } public static readonly DependencyProperty WaferDataProperty = DependencyProperty.Register(nameof(WaferData), typeof(WaferInfo), typeof(WaferCtrl), new PropertyMetadata(null)); #endregion #region IsRotary public static readonly DependencyProperty IsRotaryProperty = DependencyProperty.Register( nameof(IsRotary), typeof(bool), typeof(WaferCtrl), new PropertyMetadata(default(bool), IsRotaryPropertyChangedCallback)); private static void IsRotaryPropertyChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args) { if (obj is WaferCtrl uc && args.NewValue is bool isRotary) { var res = uc.TryFindResource("sbRotateWafer"); if (res is Storyboard sb) { if (isRotary) sb.Begin(); else sb.Stop(); } } } /// /// 设置或返回是否正在旋转。 /// public bool IsRotary { get => (bool)GetValue(IsRotaryProperty); set => SetValue(IsRotaryProperty, value); } #endregion #endregion } }