123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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<object>
- {
- Station
- };
- lstParameter.AddRange(command.Parameters);
- InvokeClient.Instance.Service.DoOperation(command.CommandName, lstParameter.ToArray());
- }
- public RfidReaderControl()
- {
- InitializeComponent();
- RFReaderCommand = new DelegateCommand<DependencyObject>(RFReaderOperation);
- root.DataContext = this;
- }
- }
- }
|