RoleView.xaml.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Windows.Controls;
  3. using System.Windows.Input;
  4. namespace MECF.Framework.UI.Client.CenterViews.Configs.Roles
  5. {
  6. /// <summary>
  7. /// Interaction logic for RoleView.xaml
  8. /// </summary>
  9. public partial class RoleView : UserControl
  10. {
  11. public RoleView()
  12. {
  13. InitializeComponent();
  14. }
  15. private void TextBox2_PreviewTextInput(object sender, TextCompositionEventArgs e)
  16. {
  17. string newText = textBox2.Text + e.Text;
  18. if (int.TryParse(newText, out int number) && number < int.MaxValue)
  19. {
  20. e.Handled = false;
  21. }
  22. else
  23. {
  24. textBox2.Text = "0";
  25. e.Handled = true;
  26. }
  27. }
  28. //private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
  29. //{
  30. // ScrollViewer viewer = scrollviewer_LotList;
  31. // if (viewer == null)
  32. // return;
  33. // double num = Math.Abs((int)(e.Delta / 2));
  34. // double offset = 0.0;
  35. // if (e.Delta > 0)
  36. // {
  37. // offset = Math.Max((double)0.0, (double)(viewer.VerticalOffset - num));
  38. // }
  39. // else
  40. // {
  41. // offset = Math.Min(viewer.ScrollableHeight, viewer.VerticalOffset + num);
  42. // }
  43. // if (offset != viewer.VerticalOffset)
  44. // {
  45. // viewer.ScrollToVerticalOffset(offset);
  46. // e.Handled = true;
  47. // }
  48. //}
  49. }
  50. }