BoatModifyView.xaml.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using MECF.Framework.Common.DataCenter;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace FurnaceUI.Views.Operations
  17. {
  18. /// <summary>
  19. /// BoatModifyView.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class BoatModifyView : UserControl
  22. {
  23. public BoatModifyView()
  24. {
  25. InitializeComponent();
  26. }
  27. private void Slot_TextChanged(object sender, TextChangedEventArgs e)
  28. {
  29. var count = (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount");
  30. TextBox tb = sender as TextBox;
  31. if (string.IsNullOrEmpty(tb.Text))
  32. {
  33. tb.BorderBrush = Brushes.Red;
  34. return;
  35. }
  36. if (Convert.ToInt32(tb.Text) > count+1 || Convert.ToInt32(tb.Text) < 1)
  37. tb.BorderBrush = Brushes.Red;
  38. else
  39. tb.BorderBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0xFF, 0x1B, 0x1B, 0x1B));
  40. }
  41. }
  42. }