using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using Aitex.Core.UI.MVVM; using Aitex.Sorter.Common; using Aitex.Sorter.UI.Controls.Common; using MECF.Framework.Common.OperationCenter; namespace Aitex.Sorter.UI.Controls { public partial class RfidReaderControl : UserControl { public static readonly DependencyProperty RfidStatusProperty = DependencyProperty.Register( "RfidStatus", typeof(string), typeof(RfidReaderControl), new PropertyMetadata(default(string))); public string RfidStatus { get { return (string) GetValue(RfidStatusProperty); } set { SetValue(RfidStatusProperty, value); } } public static readonly DependencyProperty StationProperty = DependencyProperty.Register( "Station", typeof(string), typeof(RfidReaderControl), new PropertyMetadata(default(string))); public string Station { get { return (string) GetValue(StationProperty); } set { SetValue(StationProperty, value); } } public static readonly DependencyProperty IDProperty = DependencyProperty.Register( "ID", typeof(string), typeof(RfidReaderControl), new PropertyMetadata(default(string))); public string ID { get { return (string) GetValue(IDProperty); } set { SetValue(IDProperty, value); } } public ICommand RFReaderCommand { get; private set; } void RFReaderOperation(DependencyObject sender) { var command = CommandHelper.GetCommandItem(sender); var lstParameter = new List { Station }; lstParameter.AddRange(command.Parameters); InvokeClient.Instance.Service.DoOperation(command.CommandName, lstParameter.ToArray()); } public RfidReaderControl() { InitializeComponent(); RFReaderCommand = new DelegateCommand(RFReaderOperation); root.DataContext = this; } } }