using Aitex.Sorter.UI.ViewModel; using MECF.Framework.Common.OperationCenter; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Aitex.Sorter.UI.Views { /// /// SelectOCRPicDialogView.xaml 的交互逻辑 /// public partial class SelectOCRPicDialogView :Window { private SelectOCRPicDialogViewModel selectOCRPicDialogViewModel; private string WIDReaderName { get; set; } public SelectOCRPicDialogView(string wIDReaderName) { selectOCRPicDialogViewModel = new SelectOCRPicDialogViewModel(); selectOCRPicDialogViewModel.WIDReaderName = wIDReaderName; DataContext = selectOCRPicDialogViewModel; InitializeComponent(); IsVisibleChanged += SelectOCRPicDialogViewModel_IsVisibleChanged; } private void SelectOCRPicDialogViewModel_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { (DataContext as SelectOCRPicDialogViewModel)?.EnableTimer(IsVisible); } private void Button_Click(object sender, RoutedEventArgs e) { var lstParameter = new List(); lstParameter.Insert(0, WIDReaderName); lstParameter.Insert(1, "ManualSetLaserMark"); lstParameter.Insert(2, WriteReviseLaserMak.Text); InvokeClient.Instance.Service.DoOperation("DeviceOperation", lstParameter.ToArray()); } private void Button_Click_1(object sender, RoutedEventArgs e) { this.Close(); } } }