终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

76 lines
2.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  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.Shapes;
  15. namespace BPASmartClient.CustomResource.Pages.View
  16. {
  17. /// <summary>
  18. /// PromptView.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class PromptView : Window
  21. {
  22. public PromptView()
  23. {
  24. InitializeComponent();
  25. this.main.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
  26. }
  27. public string TextBlockIcon
  28. {
  29. get { return this.icon.Text.Trim(); }
  30. set { this.icon.Text = Regex.Unescape(StringToUnicode(value.ToString())); }
  31. }
  32. public Brush TextBlockForeground
  33. {
  34. get { return this.icon.Foreground; }
  35. set { this.icon.Foreground = value; this.info.Foreground = value; }
  36. }
  37. public string TextBlockInfo
  38. {
  39. get { return this.info.Text.Trim(); }
  40. set { this.info.Text = value; }
  41. }
  42. private string StringToUnicode(string s)
  43. {
  44. if (!string.IsNullOrEmpty(s))
  45. {
  46. //这里把格式&#xe625; 转为 \ue625
  47. return s.Replace(@"&#x", @"\u").Replace(";", "");
  48. }
  49. return s;
  50. }
  51. private void Button_Click(object sender, RoutedEventArgs e)
  52. {
  53. this.DialogResult = false;
  54. this.Close();
  55. }
  56. private void Cancel_Click(object sender, RoutedEventArgs e)
  57. {
  58. this.DialogResult = false;
  59. this.Close();
  60. }
  61. private void ok_Click(object sender, RoutedEventArgs e)
  62. {
  63. this.DialogResult = true;
  64. this.Close();
  65. }
  66. }
  67. }