SaleOrderFrame.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Muchinfo.MTPClient.Data.Model.Sale;
  2. using Muchinfo.MTPClient.Sale.ViewModels;
  3. using System.Collections.Generic;
  4. using System.Windows;
  5. using System.Windows.Input;
  6. namespace Muchinfo.MTPClient.Sale.Views
  7. {
  8. /// <summary>
  9. /// SaleOrderFrame.xaml 的交互逻辑
  10. /// </summary>
  11. public partial class SaleOrderFrame : Window
  12. {
  13. public SaleOrderFrame(SaleGoods saleGoods )
  14. {
  15. InitializeComponent();
  16. this.DataContext = new SaleOrderViewModel(saleGoods);
  17. }
  18. private void Window_MouseDown(object sender, MouseButtonEventArgs e)
  19. {
  20. if (e.LeftButton == MouseButtonState.Pressed)
  21. {
  22. DragMove();
  23. }
  24. }
  25. private void btnClose_Click(object sender, RoutedEventArgs e)
  26. {
  27. this.Close();
  28. }
  29. private void DecimalUpDown_KeyDown(object sender, KeyEventArgs e)
  30. {
  31. if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || (e.Key >= Key.D0 && e.Key <= Key.D9))
  32. {
  33. e.Handled = false;
  34. }
  35. else
  36. {
  37. e.Handled = true;
  38. }
  39. }
  40. }
  41. }