HintBar.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace NEIntelligentControl2.Views.Basic
  16. {
  17. /// <summary>
  18. /// HintBar.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class HintBar : UserControl
  21. {
  22. public HintBar()
  23. {
  24. InitializeComponent();
  25. }
  26. internal void Inof(string v)
  27. {
  28. // FFCA5100 FF006CBE
  29. Dispatcher.Invoke(() =>
  30. {
  31. this.Visibility = Visibility.Visible;
  32. _SBMain.Background = new SolidColorBrush(Color.FromRgb(0x00, 0x6C, 0xBE));
  33. _TBStatus.Text = v;
  34. this.Visibility = Visibility.Visible;
  35. });
  36. }
  37. internal void Warning(string v)
  38. {
  39. Dispatcher.Invoke(() =>
  40. {
  41. this.Visibility = Visibility.Visible;
  42. _SBMain.Background = new SolidColorBrush(Color.FromRgb(0xCA, 0x51, 0x00));
  43. _TBStatus.Text = v;
  44. this.Visibility = Visibility.Visible;
  45. });
  46. }
  47. internal void Success()
  48. {
  49. Dispatcher.Invoke(() =>
  50. {
  51. this._TBStatus.Text = "就绪";
  52. _SBMain.Background = new SolidColorBrush(Colors.WhiteSmoke);
  53. this.Visibility = Visibility.Collapsed;
  54. });
  55. }
  56. }
  57. }