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 { /// /// PromptView.xaml 的交互逻辑 /// 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(); } } }