| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using ivf_tl_Manage.Converts;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- 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 ivf_tl_Manage.Win
- {
- /// <summary>
- /// MessagePrompt.xaml 的交互逻辑
- /// </summary>
- public partial class MessagePrompt : Window
- {
- private Window parent = null;
- public MessagePrompt()
- {
- InitializeComponent();
- this.Closed += (a, b) =>
- {
- if (parent != null)
- {
- parent.Activate();
- }
- };
- }
- public bool? ShowEmbryoOper(string tag, string mess, int typeState)
- {
- this.Owner = AppData.Instance.MainWindow;
- this.parent = AppData.Instance.MainWindow;
- if (tag == "完成")
- {
- TitleString = KeyToStringConvert.GetLanguageStringByKey("0517");
- }
- else
- {
- TitleString = tag;
- }
- MessageInfoString = mess;
- switch (typeState)
- {
- case 1:
- if (tag == "取消" || tag == "完成")
- {
- //TitleString = "取消冷冻";
- TitleString = $"{KeyToStringConvert.GetLanguageStringByKey("0040")}";
- WidthVisibility = Visibility.Visible;
- }
- OperImageSource = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/EmbryoState1Icon.png", UriKind.Absolute));
- break;
- case 2:
- if (tag == "取消" || tag == "完成")
- {
- //TitleString = "取消移植";
- //TitleString = $"{KeyToStringConvert.GetLanguageStringByKey("0025")} {KeyToStringConvert.GetLanguageStringByKey("0041")}";
- TitleString = $"{KeyToStringConvert.GetLanguageStringByKey("0041")}";
- WidthVisibility = Visibility.Visible;
- }
- OperImageSource = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/EmbryoState2Icon.png", UriKind.Absolute));
- break;
- case 3:
- if (tag == "取消" || tag == "完成")
- {
- //TitleString = "取消作废";
- TitleString = $"{KeyToStringConvert.GetLanguageStringByKey("0042")}";
- WidthVisibility = Visibility.Visible;
- }
- OperImageSource = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/EmbryoState3Icon.png", UriKind.Absolute));
- break;
- case 4:
- if (tag == "取消" || tag == "完成")
- {
- //TitleString = "取消删除";
- TitleString = $"{KeyToStringConvert.GetLanguageStringByKey("0043")}";
- WidthVisibility = Visibility.Visible;
- }
- OperImageSource = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/EmbryoState4Icon.png", UriKind.Absolute));
- break;
- case 5:
- OperImageSource = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/DetailEndButtonIcon.png", UriKind.Absolute));
- break;
- }
- return this.ShowDialog();
- }
- private void Cancel_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false;
- }
- private void Ok_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = true;
- }
- public string TitleString
- {
- get { return (string)GetValue(TitleStringProperty); }
- set { SetValue(TitleStringProperty, value); }
- }
- // Using a DependencyProperty as the backing store for TitleString. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty TitleStringProperty =
- DependencyProperty.Register("TitleString", typeof(string), typeof(MessagePrompt), new PropertyMetadata(null));
- public string MessageInfoString
- {
- get { return (string)GetValue(MessageInfoStringProperty); }
- set { SetValue(MessageInfoStringProperty, value); }
- }
- // Using a DependencyProperty as the backing store for MessageInfoString. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty MessageInfoStringProperty =
- DependencyProperty.Register("MessageInfoString", typeof(string), typeof(MessagePrompt), new PropertyMetadata(null));
- public ImageSource OperImageSource
- {
- get { return (ImageSource)GetValue(OperImageSourceProperty); }
- set { SetValue(OperImageSourceProperty, value); }
- }
- // Using a DependencyProperty as the backing store for OperImageSource. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty OperImageSourceProperty =
- DependencyProperty.Register("OperImageSource", typeof(ImageSource), typeof(MessagePrompt), new PropertyMetadata(null));
- public Visibility WidthVisibility
- {
- get { return (Visibility)GetValue(WidthVisibilityProperty); }
- set { SetValue(WidthVisibilityProperty, value); }
- }
- // Using a DependencyProperty as the backing store for WidthVisibility. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty WidthVisibilityProperty =
- DependencyProperty.Register("WidthVisibility", typeof(Visibility), typeof(MessagePrompt), new PropertyMetadata(Visibility.Hidden));
- }
- }
|