using Aitex.Core.Common; using Aitex.Core.Util; using Aitex.Sorter.Common; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using MECF.Framework.Common.Equipment; namespace Aitex.Sorter.UI.Controls { /// /// Aligner.xaml 的交互逻辑 /// public partial class Aligner : UserControl { public Aligner() { InitializeComponent(); root.DataContext = this; } public WaferInfo Wafer { get { return (WaferInfo)GetValue(WaferProperty); } set { SetValue(WaferProperty, value); } } // Using a DependencyProperty as the backing store for WaferItem. This enables animation, styling, binding, etc... public static readonly DependencyProperty WaferProperty = DependencyProperty.Register("Wafer", typeof(WaferInfo), typeof(Aligner), new PropertyMetadata(null)); public ModuleName Station { get { return (ModuleName)GetValue(StationProperty); } set { SetValue(StationProperty, value); } } // Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc... public static readonly DependencyProperty StationProperty = DependencyProperty.Register("Station", typeof(ModuleName), typeof(Aligner), new PropertyMetadata(ModuleName.Aligner)); public ICommand Command { get { return (ICommand)GetValue(CommandProperty); } set { SetValue(CommandProperty, value); } } // Using a DependencyProperty as the backing store for Command. This enables animation, styling, binding, etc... public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(Aligner), new PropertyMetadata(null)); public ICommand WaferTransferCommand { get { return (ICommand)GetValue(WaferTransferCommandProperty); } set { SetValue(WaferTransferCommandProperty, value); } } // Using a DependencyProperty as the backing store for WaferMovementCommand. This enables animation, styling, binding, etc... public static readonly DependencyProperty WaferTransferCommandProperty = DependencyProperty.Register("WaferTransferCommand", typeof(ICommand), typeof(Aligner), new PropertyMetadata(null)); public ICommand WaferTransferOptionCommand { get { return (ICommand)GetValue(WaferTransferOptionCommandProperty); } set { SetValue(WaferTransferOptionCommandProperty, value); } } // Using a DependencyProperty as the backing store for WaferTransferOptionCommand. This enables animation, styling, binding, etc... public static readonly DependencyProperty WaferTransferOptionCommandProperty = DependencyProperty.Register("WaferTransferOptionCommand", typeof(ICommand), typeof(Aligner), new PropertyMetadata(null)); public int RotateAngel { get { return (int)GetValue(RotateAngelProperty); } set { SetValue(RotateAngelProperty, value); } } // Using a DependencyProperty as the backing store for RotateAngel. This enables animation, styling, binding, etc... public static readonly DependencyProperty RotateAngelProperty = DependencyProperty.Register("RotateAngel", typeof(int), typeof(Aligner), new PropertyMetadata(0)); private void MenuItem_Click(object sender, RoutedEventArgs e) { var cmd = ((MenuItem)sender).Tag; Command.Execute(new[] { Station.ToString(), cmd }); } } }