Sic04/SicUI/Controls/WaferCtrl.xaml.cs

55 lines
1.7 KiB
C#
Raw Normal View History

2022-09-19 09:16:33 +08:00
using System.Windows;
2022-11-15 23:33:34 +08:00
using System.Windows.Media.Animation;
2022-09-19 09:16:33 +08:00
using MECF.Framework.UI.Client.ClientBase;
namespace SicUI.Controls
{
/// <summary>
/// WaferCtrl.xaml 的交互逻辑
/// </summary>
2022-11-15 23:33:34 +08:00
public partial class WaferCtrl
2022-09-19 09:16:33 +08:00
{
public WaferCtrl()
{
InitializeComponent();
}
2022-11-15 23:33:34 +08:00
public static readonly DependencyProperty WaferDataProperty =
DependencyProperty.Register(nameof(WaferData), typeof(WaferInfo), typeof(WaferCtrl), new PropertyMetadata(null));
2022-09-19 09:16:33 +08:00
public WaferInfo WaferData
{
2022-11-15 23:33:34 +08:00
get => (WaferInfo)GetValue(WaferDataProperty);
set => SetValue(WaferDataProperty, value);
2022-09-19 09:16:33 +08:00
}
2022-11-15 23:33:34 +08:00
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();
}
}
}
/// <summary>
/// 设置或返回是否正在旋转。
/// </summary>
public bool IsRotary
{
get => (bool)GetValue(IsRotaryProperty);
set => SetValue(IsRotaryProperty, value);
}
2022-09-19 09:16:33 +08:00
}
}