|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
-
- namespace BPASmartClient.CustomResource.Pages.View
- {
- /// <summary>
- /// PromptView.xaml 的交互逻辑
- /// </summary>
- public partial class PromptView : Window
- {
- public PromptView()
- {
- InitializeComponent();
- this.main.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
- }
-
- public string TextBlockIcon
- {
- get { return this.icon.Text.Trim(); }
- set { this.icon.Text = Regex.Unescape(StringToUnicode(value.ToString())); }
- }
-
- public Brush TextBlockForeground
- {
- get { return this.icon.Foreground; }
- set { this.icon.Foreground = value; this.info.Foreground = value; }
- }
-
- public string TextBlockInfo
- {
- get { return this.info.Text.Trim(); }
- set { this.info.Text = value; }
- }
-
- private string StringToUnicode(string s)
- {
- if (!string.IsNullOrEmpty(s))
- {
- //这里把格式 转为 \ue625
- return s.Replace(@"&#x", @"\u").Replace(";", "");
- }
- return s;
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false;
- this.Close();
- }
-
- private void Cancel_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false;
- this.Close();
- }
-
- private void ok_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = true;
- this.Close();
- }
- }
- }
|