|
- using BPASmartClient.DosingSystem.ViewModel;
- using System;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
-
- namespace BPASmartClient.DosingSystem.View
- {
- /// <summary>
- /// RecipeControlView.xaml 的交互逻辑
- /// </summary>
- public partial class RecipeControlView : UserControl
- {
- public RecipeControlView()
- {
- InitializeComponent();
- RadioButtonWait_Click(null, null);
- UseTheScrollViewerScrolling(CookingGrid);
- }
-
- public void UseTheScrollViewerScrolling(FrameworkElement fElement)
- {
- fElement.PreviewMouseWheel += (sender, e) =>
- {
- var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
- eventArg.RoutedEvent = UIElement.MouseWheelEvent;
- eventArg.Source = sender;
- fElement.RaiseEvent(eventArg);
- };
- }
-
-
- private void RadioButtonCompelete_Click(object sender, RoutedEventArgs e)
- {
- //repiceList.ItemsSource = RecipeControlViewModel.UserTreeCompelete;
- //repiceList.Visibility = Visibility.Visible;
- //repiceListMaking.Visibility = Visibility.Hidden;
- this.Wait.ItemsSource = ExcuteControl.GetInstance.UserTreeCompelete;
- CookingGrid.Visibility = Visibility.Collapsed;
- WaitOrCompleteGrid.Visibility = Visibility.Visible;
- this.Wait.Visibility = Visibility.Visible;
- }
-
- private void RadioButtonWait_Click(object sender, RoutedEventArgs e)
- {
- //repiceList.ItemsSource = RecipeControlViewModel.UserTreeWait;
- //repiceList.Visibility = Visibility.Visible;
- //repiceListMaking.Visibility = Visibility.Hidden;
- this.Wait.ItemsSource = ExcuteControl.GetInstance.UserTreeWait;
- CookingGrid.Visibility = Visibility.Collapsed;
- WaitOrCompleteGrid.Visibility = Visibility.Visible;
- this.Wait.Visibility = Visibility.Visible;
- }
-
- private void RadioButtonMaking_Click(object sender, RoutedEventArgs e)
- {
- //repiceListMaking.Visibility = Visibility.Visible;
- //repiceList.Visibility = Visibility.Hidden;
- WaitOrCompleteGrid.Visibility = Visibility.Collapsed;
- this.Wait.Visibility = Visibility.Collapsed;
- CookingGrid.Visibility = Visibility.Visible;
- }
-
- private void TextBox_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
- {
-
- TextBox textBox = sender as TextBox;
- if (textBox != null && textBox.Text != "")
- {
- foreach (char c in e.Text)
- {
- if (!char.IsDigit(c))
- {
- string text = textBox.Text;
- text = text.Replace(e.Text, "");
- int t = int.Parse(text);
- textBox.Text = t.ToString();
- e.Handled = true;
- return;
- }
-
- }
- }
- }
-
- private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
- {
- TextBox textBox = sender as TextBox;
- if (textBox != null && textBox.Text != "")
- {
- textBox.Text = int.Parse(textBox.Text).ToString();
- }
- }
- }
- }
|