终端一体化运控平台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

96 linhas
3.4 KiB

  1. using BPASmartClient.DosingSystem.ViewModel;
  2. using System;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. using System.Windows.Input;
  6. namespace BPASmartClient.DosingSystem.View
  7. {
  8. /// <summary>
  9. /// RecipeControlView.xaml 的交互逻辑
  10. /// </summary>
  11. public partial class RecipeControlView : UserControl
  12. {
  13. public RecipeControlView()
  14. {
  15. InitializeComponent();
  16. RadioButtonWait_Click(null, null);
  17. UseTheScrollViewerScrolling(CookingGrid);
  18. }
  19. public void UseTheScrollViewerScrolling(FrameworkElement fElement)
  20. {
  21. fElement.PreviewMouseWheel += (sender, e) =>
  22. {
  23. var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
  24. eventArg.RoutedEvent = UIElement.MouseWheelEvent;
  25. eventArg.Source = sender;
  26. fElement.RaiseEvent(eventArg);
  27. };
  28. }
  29. private void RadioButtonCompelete_Click(object sender, RoutedEventArgs e)
  30. {
  31. //repiceList.ItemsSource = RecipeControlViewModel.UserTreeCompelete;
  32. //repiceList.Visibility = Visibility.Visible;
  33. //repiceListMaking.Visibility = Visibility.Hidden;
  34. this.Wait.ItemsSource = ExcuteControl.GetInstance.UserTreeCompelete;
  35. CookingGrid.Visibility = Visibility.Collapsed;
  36. WaitOrCompleteGrid.Visibility = Visibility.Visible;
  37. this.Wait.Visibility = Visibility.Visible;
  38. }
  39. private void RadioButtonWait_Click(object sender, RoutedEventArgs e)
  40. {
  41. //repiceList.ItemsSource = RecipeControlViewModel.UserTreeWait;
  42. //repiceList.Visibility = Visibility.Visible;
  43. //repiceListMaking.Visibility = Visibility.Hidden;
  44. this.Wait.ItemsSource = ExcuteControl.GetInstance.UserTreeWait;
  45. CookingGrid.Visibility = Visibility.Collapsed;
  46. WaitOrCompleteGrid.Visibility = Visibility.Visible;
  47. this.Wait.Visibility = Visibility.Visible;
  48. }
  49. private void RadioButtonMaking_Click(object sender, RoutedEventArgs e)
  50. {
  51. //repiceListMaking.Visibility = Visibility.Visible;
  52. //repiceList.Visibility = Visibility.Hidden;
  53. WaitOrCompleteGrid.Visibility = Visibility.Collapsed;
  54. this.Wait.Visibility = Visibility.Collapsed;
  55. CookingGrid.Visibility = Visibility.Visible;
  56. }
  57. private void TextBox_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
  58. {
  59. TextBox textBox = sender as TextBox;
  60. if (textBox != null && textBox.Text != "")
  61. {
  62. foreach (char c in e.Text)
  63. {
  64. if (!char.IsDigit(c))
  65. {
  66. string text = textBox.Text;
  67. text = text.Replace(e.Text, "");
  68. int t = int.Parse(text);
  69. textBox.Text = t.ToString();
  70. e.Handled = true;
  71. return;
  72. }
  73. }
  74. }
  75. }
  76. private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
  77. {
  78. TextBox textBox = sender as TextBox;
  79. if (textBox != null && textBox.Text != "")
  80. {
  81. textBox.Text = int.Parse(textBox.Text).ToString();
  82. }
  83. }
  84. }
  85. }