| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608 |
- using ivf_tl_Entity.Entity.balance;
- using ivf_tl_Entity.Enums;
- using ivf_tl_Manage.Converts;
- using ivf_tl_Manage.ViewModels;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Threading;
- 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.Animation;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using static log4net.Appender.RollingFileAppender;
- using static System.Formats.Asn1.AsnWriter;
- using static System.Net.Mime.MediaTypeNames;
- using Image = System.Windows.Controls.Image;
- namespace ivf_tl_Manage.UserControls
- {
- /// <summary>
- /// MarkDetailItem.xaml 的交互逻辑
- /// </summary>
- public partial class MarkDetailItem : UserControl
- {
- public event Action<Embryo, long> MarkDetailEvent;
- public Action<int> ChangeAction;
- public MarkDetailItem()
- {
- InitializeComponent();
- ChangeAction += Change;
- }
- //public double MinuteWidth = 1120d / 10080d;
- public double MinuteWidth = 1225d / 10080d;
- public void Change(int i)
- {
- try
- {
- Dispatcher.Invoke(() =>
- {
- SetProgress(0.01f * i, bd_progress);
- });
- }
- catch (Exception)
- {
- }
- }
- public new Brush Background
- {
- get { return (Brush)GetValue(BackgroundProperty); }
- set { SetValue(BackgroundProperty, value); }
- }
- public static new readonly DependencyProperty BackgroundProperty =
- DependencyProperty.Register("Background", typeof(Brush), typeof(MarkDetailItem), new PropertyMetadata(null, new PropertyChangedCallback(OnBackgroundPropertyChangedCallback)));
- private static void OnBackgroundPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- SolidColorBrush solidColorBrush = (SolidColorBrush)e.NewValue;
- if (solidColorBrush == null) return;
- source._container.Background = solidColorBrush;
- }
- /// <summary>
- /// 培养进度传(0-100的值)
- /// </summary>
- public double Progress
- {
- get { return (double)GetValue(ProgressProperty); }
- set { SetValue(ProgressProperty, value); }
- }
- public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register("Progress", typeof(double),
- typeof(MarkDetailItem), new PropertyMetadata(0d, new PropertyChangedCallback(OnProgressPropertyChange)));
- static void OnProgressPropertyChange(DependencyObject sender, DependencyPropertyChangedEventArgs args)
- {
- MarkDetailItem source = (MarkDetailItem)sender;
- double data = (double)args.NewValue;
- Thread t = new Thread(() =>
- {
- int m = 0;
- while (m < data)
- {
- Thread.Sleep(10);
- //Console.WriteLine(m.ToString());
- m++;
- source.ChangeAction?.Invoke(m);
- }
- });
- t.Start();
- }
- public int State
- {
- get { return (int)GetValue(StateProperty); }
- set { SetValue(StateProperty, value); }
- }
- // Using a DependencyProperty as the backing store for State. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty StateProperty =
- DependencyProperty.Register("State", typeof(int), typeof(MarkDetailItem), new PropertyMetadata(-1, new PropertyChangedCallback(StatePropertyChangedCallback)));
- private static void StatePropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is int state)) return;
- switch (state)
- {
- case 1: //冷冻
- source.st_operate.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_bgBlue.png", UriKind.Absolute)));
- source.img_icon.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_freeze.png", UriKind.Absolute));
- break;
- case 2://移植
- source.st_operate.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_bgGreen.png", UriKind.Absolute)));
- source.img_icon.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_transplant.png", UriKind.Absolute));
- break;
- case 3://作废
- source.st_operate.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_bgRed.png", UriKind.Absolute)));
- source.img_icon.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_x.png", UriKind.Absolute));
- break;
- case 4:
- break;
- case 5://删除
- source.st_operate.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_bgRed.png", UriKind.Absolute)));
- source.img_icon.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_delete.png", UriKind.Absolute));
- break;
- default:
- break;
- }
- }
- public string Number
- {
- get { return (string)GetValue(NumberProperty); }
- set { SetValue(NumberProperty, value); }
- }
- public static readonly DependencyProperty NumberProperty =
- DependencyProperty.Register("Number", typeof(string), typeof(MarkDetailItem), new PropertyMetadata("", new PropertyChangedCallback(OnNumberPropertyChangedCallback)));
- private static void OnNumberPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is string number)) return;
- source.tb_textNumber.Text = number;
- }
- public double Score
- {
- get { return (double)GetValue(ScoreProperty); }
- set { SetValue(ScoreProperty, value); }
- }
- // Using a DependencyProperty as the backing store for Score. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty ScoreProperty =
- DependencyProperty.Register("Score", typeof(double), typeof(MarkDetailItem), new PropertyMetadata(0d, new PropertyChangedCallback(ScorePropertyChangedCallback)));
- private static void ScorePropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- //if (!(d is MarkDetailItem source)) return;
- //if (!(e.NewValue is double score)) return;
- //source.tb_score.Text = score.ToString();
- }
- public Embryo EmbryoData
- {
- get { return (Embryo)GetValue(EmbryoDataProperty); }
- set { SetValue(EmbryoDataProperty, value); }
- }
- // Using a DependencyProperty as the backing store for EmbryoData. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty EmbryoDataProperty =
- DependencyProperty.Register("EmbryoData", typeof(Embryo), typeof(MarkDetailItem), new PropertyMetadata(null, new PropertyChangedCallback(EmbryoDataPropertyChangedCallback)));
- private static void EmbryoDataPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- Debug.WriteLine($"{e.OldValue}->{e.NewValue}");
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is Embryo embryoData)) return;
- string imageurl = $"{AppData.Instance.BaseUrl}{embryoData.imageUrl}?token={AppData.Instance.HttpServiceCall.GetToken()}";
- source._image.Source = AppData.Instance.StringToBitmapImage(imageurl);
- if (embryoData.score == -1)
- source.tb_score.Text = "";
- else
- source.tb_score.Text = $"{embryoData.score}";//-{embryoData.level}
- foreach (var item in embryoData.embryoMark)
- {
- StackPanel stackPanel = new StackPanel();
- stackPanel.Background = new SolidColorBrush(Colors.Transparent);
- stackPanel.MouseEnter += source.Image_MouseEnter;
- stackPanel.MouseLeave += source.Image_MouseLeave;
- stackPanel.Tag = item;
- Rectangle rectangle = new Rectangle();
- stackPanel.Children.Add(rectangle);
- rectangle.Width = 5;
- rectangle.Height = 15;
- rectangle.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ffb000"));
- //Image image = new Image();
- //stackPanel.Children.Add(image);
- //image.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_xiaohuangkuai.png", UriKind.Absolute));
- //image.MouseEnter += source.Image_MouseEnter;
- //image.MouseLeave += source.Image_MouseLeave;
- //image.Width = 22;
- //image.Height = 24;
- //image.SetValue(Canvas.LeftProperty, left);
- //image.SetValue(Canvas.TopProperty, 96d);
- //image.Tag = item;
- TextBlock textBlock = new TextBlock();
- stackPanel.Children.Add(textBlock);
- textBlock.Text = item.markName;
- textBlock.FontSize = 16;
- if (item.markType == "AI_RECTIFY")
- {
- textBlock.Foreground = new SolidColorBrush(Colors.Red);
- }
- double Minutes = item.developTime;
- if (Minutes > 10080)
- {
- Minutes = 10080;
- }
- double left = Minutes * source.MinuteWidth - stackPanel.ActualWidth / 2d;
- //stackPanel.SetValue(Canvas.LeftProperty, left);
- stackPanel.SetBinding(Canvas.LeftProperty, new Binding("ActualWidth")
- {
- RelativeSource = new RelativeSource(RelativeSourceMode.Self),
- Converter = new LeftConvert(),
- ConverterParameter = Minutes * source.MinuteWidth,
- Mode = BindingMode.OneWay,
- });
- stackPanel.SetValue(Canvas.TopProperty, 93d);
- source._cellContainer.Children.Add(stackPanel);
- }
- }
- private static void EmbryoDataPropertyChangedCallback1(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- //Debug.WriteLine($"{e.OldValue}->{e.NewValue}");
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is Embryo embryoData)) return;
- string imageurl = $"{AppData.Instance.BaseUrl}{embryoData.imageUrl}?token={AppData.Instance.HttpServiceCall.GetToken()}";
- source._image.Source = AppData.Instance.StringToBitmapImage(imageurl);
- if (embryoData.score == -1)
- source.tb_score.Text = "";
- else
- source.tb_score.Text = $"{embryoData.score}-{embryoData.level}";
- foreach (var item in embryoData.embryoMark)
- {
- Image image = new Image();
- image.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_xiaohuangkuai.png", UriKind.Absolute));
- image.MouseEnter += source.Image_MouseEnter;
- image.MouseLeave += source.Image_MouseLeave;
- image.Width = 22;
- image.Height = 24;
- double Minutes = item.developTime;
- double left = Minutes * source.MinuteWidth - image.Width / 2d;
- image.SetValue(Canvas.LeftProperty, left);
- image.SetValue(Canvas.TopProperty, 96d);
- image.Tag = item;
- //Rectangle rectangle = new Rectangle();
- //rectangle.Width = 24;
- //rectangle.Height = 24;
- //rectangle.Fill = new SolidColorBrush(Colors.Red);
- //rectangle.SetValue(Canvas.LeftProperty, left);
- //rectangle.SetValue(Canvas.TopProperty, 96d);
- source._cellContainer.Children.Add(image);
- //source.tb_title.Text = (item.markName == null ? "" : item.markName) + item.markType;
- //source.tb_title.Text = item.markType;
- }
- }
- public string FaYuTime
- {
- get { return (string)GetValue(FaYuTimeProperty); }
- set { SetValue(FaYuTimeProperty, value); }
- }
- // Using a DependencyProperty as the backing store for FaYuTime. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty FaYuTimeProperty =
- DependencyProperty.Register("FaYuTime", typeof(string), typeof(MarkDetailItem), new PropertyMetadata("", new PropertyChangedCallback(OnFaYuPropertyChangedCallback)));
- private static void OnFaYuPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- try
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is string faYuTime)) return;
- if (source.EmbryoData == null) return;
- if (source.EmbryoData.wellSn == 4)
- {
- string ss = "";
- }
- TimeSpan t3 = new TimeSpan();
- if (source.State != (int)EmbryoState.None)
- {
- if (DateTime.TryParse(source.EmbryoData.stateTime, out DateTime newTime))
- {
- t3 = newTime - DateTime.Parse(source.EmbryoData.startTime);
- }
- }
- else
- {
- t3 = DateTime.Now - DateTime.Parse(source.EmbryoData.startTime);
- }
- double Minutes = t3.TotalMinutes;
- //double progress = Minutes * source.MinuteWidth / 1120d * 100d;
- double progress = Minutes * source.MinuteWidth / 1225d * 100d;
- //double progress = double.Parse(faYuTime) / 168d * 100;
- source.Progress = progress;
- var childs = source.st_container.Children;
- //double count24 = double.Parse(faYuTime) / 24d;
- double count24 = Minutes / 1440d;
- int intCount24 = (int)count24;
- for (int i = 0; i < intCount24; i++)
- {
- if (i == childs.Count)
- break;
- Border? border = childs[i] as Border;
- if (border == null)
- continue;
- border.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#95B1DA"));
- TextBlock? textBlock = border.Child as TextBlock;
- if (textBlock == null)
- continue;
- textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFFF"));
- }
- }
- catch (Exception ex)
- {
- return;
- }
- }
- public string StateTime
- {
- get { return (string)GetValue(StateTimeProperty); }
- set { SetValue(StateTimeProperty, value); }
- }
- // Using a DependencyProperty as the backing store for StateTime. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty StateTimeProperty =
- DependencyProperty.Register("StateTime", typeof(string), typeof(MarkDetailItem), new PropertyMetadata("2023-11-11 23:59:59", new PropertyChangedCallback(StateTimePropertyChangedCallback)));
- private static void StateTimePropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is string stateTime)) return;
- if (source.EmbryoData == null) return;
- if (source.State == (int)EmbryoState.None || source.State == (int)EmbryoState.End) return;
- DateTime time = DateTime.Parse(stateTime);
- source.tb_icon_time.Text = $"{time.Month}-{time.Day} {time.Hour}:{time.Minute}";
- TimeSpan t3 = time - DateTime.Parse(source.EmbryoData.startTime);
- double Minutes = t3.TotalMinutes;
- if (Minutes > 10080) Minutes = 10080;
- double left = Minutes * source.MinuteWidth - source.st_operate.Width / 2;
- source.st_operate.SetValue(Canvas.LeftProperty, left);
- }
- public string Level
- {
- get { return (string)GetValue(LevelProperty); }
- set { SetValue(LevelProperty, value); }
- }
- // Using a DependencyProperty as the backing store for Level. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty LevelProperty =
- DependencyProperty.Register("Level", typeof(string), typeof(MarkDetailItem), new PropertyMetadata("", new PropertyChangedCallback(LevelPropertyChangedCallback)));
- private static void LevelPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is string level)) return;
- source.tb_level.Text = level;
- }
- public string ImageSource
- {
- get { return (string)GetValue(ImageSourceProperty); }
- set { SetValue(ImageSourceProperty, value); }
- }
- public static readonly DependencyProperty ImageSourceProperty =
- DependencyProperty.Register("ImageSource", typeof(string), typeof(MarkDetailItem), new PropertyMetadata(null, new PropertyChangedCallback(OnImageSourcePropertyChangedCallback)));
- private static void OnImageSourcePropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is string uri)) return;
- source._image.Source = new BitmapImage(new Uri(uri));
- }
- private void SetProgress(double value, Border border)
- {
- LinearGradientBrush brush = new LinearGradientBrush();
- brush.StartPoint = new Point(0, 0);//X横向 //1,1是path右下角
- brush.EndPoint = new Point(1, 0);//Y纵向 //1,0是path右上角 从下而上
- GradientStop stop1 = new GradientStop();
- stop1.Color = Color.FromArgb(255, 102, 138, 189);
- stop1.Offset = 0;
- GradientStop stop2 = new GradientStop();
- stop2.Color = Color.FromArgb(255, 102, 138, 189);
- stop2.Offset = value;
- GradientStop stop3 = new GradientStop();
- stop3.Color = Color.FromArgb(255, 207, 207, 207);
- stop3.Offset = value + 0.0001;
- brush.GradientStops = new GradientStopCollection() { stop1, stop2, stop3 };
- border.Background = brush;
- }
- private void Image_MouseEnter(object sender, MouseEventArgs e)
- {
- st_markData.Children.Clear();
- if (!(sender is StackPanel image)) return;
- //Image? image = sender as Image;
- //if (image == null)
- // return;
- //image.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_enter.png", UriKind.Absolute));
- EmbryoMark? embryoMark = image.Tag as EmbryoMark;
- if (embryoMark == null) return;
- tb_title.Text = embryoMark.markName;
- if (embryoMark.score == -1)
- {
- //embryoMark.markName == "囊胚" && !string.IsNullOrEmpty(EmbryoData.blastocystLevel)
- if (embryoMark.markName == KeyToStringConvert.GetLanguageStringByKey("0293") && !string.IsNullOrEmpty(EmbryoData.blastocystLevel))
- {
- TextBlock_Score.Visibility = Visibility.Visible;
- TextBlock_Score.Text = $"({EmbryoData.blastocystLevel})";
- }
- else
- {
- TextBlock_Score.Visibility = Visibility.Collapsed;
- }
- }
- else
- {
- TextBlock_Score.Visibility = Visibility.Visible;
- TextBlock_Score.Text = $"({embryoMark.score.ToString("F2")})";
- }
- if (embryoMark.markType == "MANUAL_MARK")
- {
- this.Border_ShouDong.Visibility = Visibility.Visible;
- }
- else
- {
- this.Border_ShouDong.Visibility = Visibility.Hidden;
- }
- this.markDevTime.Text = $"{(embryoMark.developTime / 60).ToString("D2")}h:{(embryoMark.developTime % 60).ToString("D2")}m";
- //<StackPanel Orientation="Horizontal" Background="Transparent" Margin="50,10,0,0">
- // <TextBlock Text="发育时长:" FontSize="16" Foreground="#707070" FontWeight="Medium"></TextBlock>
- // <TextBlock Text="52h50m" Margin="15,0,0,0" FontSize="16" Foreground="#4D4D4D" FontWeight="Medium"></TextBlock>
- // </StackPanel>
- // <StackPanel Orientation="Horizontal" Background="Transparent" Margin="50,10,0,0">
- // <TextBlock Text="发育时长:" FontSize="16" Foreground="#707070" FontWeight="Medium"></TextBlock>
- // <TextBlock Text="52h50m" Margin="15,0,0,0" FontSize="16" Foreground="#4D4D4D" FontWeight="Medium"></TextBlock>
- // </StackPanel>
- if (embryoMark.children != null)
- {
-
- foreach (var item in embryoMark.children)
- {
- KeyValuePair<string, string> keyValuePair = FindData(item, item.markName);
- StackPanel stackPanel = new StackPanel();
- stackPanel.Orientation = Orientation.Horizontal;
- stackPanel.Margin = new Thickness(20, 12, 0, 0);
- TextBlock textBlock = CreateTextTitle(true);
- textBlock.Text = keyValuePair.Key + ":";
- TextBlock textBlock1 = CreateTextTitle(false);
- textBlock1.Margin = new Thickness(15, 0, 0, 0);
- textBlock1.Text = keyValuePair.Value;
- stackPanel.Children.Add(textBlock);
- stackPanel.Children.Add(textBlock1);
- st_markData.Children.Add(stackPanel);
- }
- }
- Grid grid = new Grid(); ;
- grid.Height = 20;
- grid.Background = new SolidColorBrush(Colors.Transparent);
- st_markData.Children.Add(grid);
- _popup.PlacementTarget = image;
- _popup.IsOpen = true;
- }
- private KeyValuePair<string, string> FindData(EmbryoMark embryoMark, string markName)
- {
- if (embryoMark.child == 1)
- {
- return FindData(embryoMark.children[0], embryoMark.markName);
- }
- else
- {
- KeyValuePair<string, string> keyValuePair = new KeyValuePair<string, string>(markName, embryoMark.markName);
- return keyValuePair;
- }
- }
- public string DishIdString
- {
- get { return (string)GetValue(DishIdStringProperty); }
- set { SetValue(DishIdStringProperty, value); }
- }
- // Using a DependencyProperty as the backing store for DishIdString. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty DishIdStringProperty =
- DependencyProperty.Register("DishIdString", typeof(string), typeof(MarkDetailItem), new PropertyMetadata(null, new PropertyChangedCallback(StringToDishId)));
- private static void StringToDishId(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (!(d is MarkDetailItem source)) return;
- if (!(e.NewValue is string level))
- {
- source.DishId = 0;
- return;
- }
- if (long.TryParse(level, out long dishId))
- {
- source.DishId = dishId;
- }
- else
- {
- source.DishId = 0;
- }
- }
- public long DishId
- {
- get { return (long)GetValue(DishIdProperty); }
- set { SetValue(DishIdProperty, value); }
- }
- // Using a DependencyProperty as the backing store for DishId. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty DishIdProperty =
- DependencyProperty.Register("DishId", typeof(long), typeof(MarkDetailItem), new PropertyMetadata(0L));
- private static TextBlock CreateTextTitle(bool isTitle)
- {
- TextBlock textBlock = new TextBlock();
- if (isTitle)
- textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#707070"));
- else
- textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#4D4D4D"));
- textBlock.FontSize = 16;
- textBlock.FontWeight = FontWeights.Medium;
- return textBlock;
- }
- private void Image_MouseLeave(object sender, MouseEventArgs e)
- {
- _popup.IsOpen = false;
- return;
- Image? image = sender as Image;
- if (image == null)
- return;
- image.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Manage;component/Resources/Images/markdetail_xiaohuangkuai.png", UriKind.Absolute));
- //_popup.PlacementTarget = huangkuai;
- _popup.IsOpen = false;
- }
- private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (EmbryoData == null) return;
- MarkDetailEvent?.Invoke(EmbryoData, DishId);
- //AppData.Instance.MainWindowViewModel.CurrentViewModle = new MarkDetailViewModel1(EmbryoData, DishId);
- }
- }
- }
|