SelectOCRPicDialogView.xaml.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Aitex.Sorter.UI.ViewModel;
  2. using MECF.Framework.Common.OperationCenter;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace Aitex.Sorter.UI.Views
  18. {
  19. /// <summary>
  20. /// SelectOCRPicDialogView.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class SelectOCRPicDialogView :Window
  23. {
  24. private SelectOCRPicDialogViewModel selectOCRPicDialogViewModel;
  25. private string WIDReaderName { get; set; }
  26. public SelectOCRPicDialogView(string wIDReaderName)
  27. {
  28. selectOCRPicDialogViewModel = new SelectOCRPicDialogViewModel();
  29. selectOCRPicDialogViewModel.WIDReaderName = wIDReaderName;
  30. DataContext = selectOCRPicDialogViewModel;
  31. InitializeComponent();
  32. IsVisibleChanged += SelectOCRPicDialogViewModel_IsVisibleChanged;
  33. }
  34. private void SelectOCRPicDialogViewModel_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  35. {
  36. (DataContext as SelectOCRPicDialogViewModel)?.EnableTimer(IsVisible);
  37. }
  38. private void Button_Click(object sender, RoutedEventArgs e)
  39. {
  40. var lstParameter = new List<object>();
  41. lstParameter.Insert(0, WIDReaderName);
  42. lstParameter.Insert(1, "ManualSetLaserMark");
  43. lstParameter.Insert(2, WriteReviseLaserMak.Text);
  44. InvokeClient.Instance.Service.DoOperation("DeviceOperation", lstParameter.ToArray());
  45. }
  46. private void Button_Click_1(object sender, RoutedEventArgs e)
  47. {
  48. this.Close();
  49. }
  50. }
  51. }