using ivf_tl_Entity.DTO;
using ivf_tl_Entity.GlobalEntitys;
using ivf_tl_Entity.GlobalEnums;
using ivf_tl_Operate.Converts;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace ivf_tl_Operate.CustomUserControls
{
///
/// CustomDishInfo.xaml 的交互逻辑
///
public partial class CustomDishInfo : UserControl
{
public event Action ChangeSelectdIndexEvent;
public event Action IsMaxChangedEvent;
public int selectedIndex = 0;
private List TextBlockList = new List();
private Dictionary operateImageList = new Dictionary();
private Dictionary picImageList = new Dictionary();
private Dictionary BackBorderList = new Dictionary();
private int ellipseCount = 16;
private double operateBigRadius = 732;
private double imageBigRadius = 632;
private double textBigRadius = 500;
private double operateRadius = 20;
private double imageRadius = 107;
private double centerX = 0;
private double centerY = 0;
private double angle = 0;
///
/// 旋转角度
///
private double angleOffset = 90;
///
/// 字体默认颜色
///
private Color DefaultFontColor { get; set; } = Color.FromArgb(255, 110, 114, 118);
///
/// 字体选中颜色
///
private Color SelectFontColor { get; set; } = Colors.White;
bool isInit = false;
public CustomDishInfo()
{
InitializeComponent();
centerX = this._canvas.Width / 2;
centerY = this._canvas.Height / 2;
angle = 360d / ellipseCount;
Unloaded += (s, e) =>
{
if (ExDishSource == null) return;
foreach (var item in ExDishSource.embryoList)
{
item.AlarmChangedEvent -= EmbryoAlarmEvent;
}
ExDishSource = null;
this._canvas.Children.Clear();
};
}
private void InitCustom()
{
for (int i = 0; i < ellipseCount; i++)
{
TextBlock borderT = new TextBlock();
Panel.SetZIndex(borderT, 11);
this._canvas.Children.Add(borderT);
borderT.Height = 28;
borderT.Width = 35;
borderT.SetValue(Canvas.LeftProperty, centerX + Math.Cos(((angle * i + angleOffset) * (Math.PI)) / 180) * textBigRadius - borderT.Width / 2);
borderT.SetValue(Canvas.TopProperty, centerY + Math.Sin(((angle * i + angleOffset) * (Math.PI)) / 180) * textBigRadius - borderT.Height / 2);
borderT.Text = $"{i + 1}";
borderT.TextAlignment = TextAlignment.Center;
borderT.FontSize = 27;
if (i == 0)
{
borderT.Foreground = new SolidColorBrush(SelectFontColor);
}
else
{
borderT.Foreground = new SolidColorBrush(DefaultFontColor);
}
TextBlockList.Add(borderT);
Image operateBorder = new Image();
Panel.SetZIndex(operateBorder, 13);
this._canvas.Children.Add(operateBorder);
operateImageList.Add((i + 1), operateBorder);
operateBorder.Width = operateRadius * 2;
operateBorder.Height = operateRadius * 2;
operateBorder.SetValue(Canvas.LeftProperty, centerX + Math.Cos(((angle * i + angleOffset) * (Math.PI)) / 180) * operateBigRadius - operateBorder.Width / 2);
operateBorder.SetValue(Canvas.TopProperty, centerY + Math.Sin(((angle * i + angleOffset) * (Math.PI)) / 180) * operateBigRadius - operateBorder.Height / 2);
operateBorder.Visibility = Visibility.Collapsed;
Border imageBorder = new Border();
Panel.SetZIndex(imageBorder, 12);
this._canvas.Children.Add(imageBorder);
Image embryoImage = new Image();
imageBorder.Child = embryoImage;
EllipseGeometry ellipseGeometry = new EllipseGeometry(new Point(imageRadius, imageRadius), imageRadius - 3, imageRadius - 3);
embryoImage.SetValue(Image.ClipProperty, ellipseGeometry);
imageBorder.Tag = i;
imageBorder.Width = imageRadius * 2;
imageBorder.Height = imageRadius * 2;
embryoImage.Width = imageRadius * 2;
embryoImage.Height = imageRadius * 2;
picImageList.Add(i + 1, embryoImage);
imageBorder.SetValue(Canvas.LeftProperty, centerX + Math.Cos(((angle * i + angleOffset) * (Math.PI)) / 180) * imageBigRadius - imageBorder.Width / 2);
imageBorder.SetValue(Canvas.TopProperty, centerY + Math.Sin(((angle * i + angleOffset) * (Math.PI)) / 180) * imageBigRadius - imageBorder.Height / 2);
imageBorder.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/ellipse_backgroud.png", UriKind.Absolute)));
//border.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/ellipse_backgroud.png", UriKind.RelativeOrAbsolute));
//if (i > 10)
//{
// border.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/ellipse_noembryo.png", UriKind.RelativeOrAbsolute));
//}
imageBorder.MouseDown += (s, e) =>
{
if (!(s is Border source)) return;
int index = (int)source.Tag;
if (selectedIndex == index) return;
SelectIndex(index);
ChangeSelectdIndexEvent?.Invoke(index + 1);
};
}
}
public void InitCustomNew()
{
for (int i = 0; i < ellipseCount; i++)
{
TextBlock borderT = new TextBlock();
TextBlockList.Add(borderT);
Panel.SetZIndex(borderT, 11);
this._canvas.Children.Add(borderT);
borderT.Height = 28;
borderT.Width = 35;
borderT.SetValue(Canvas.LeftProperty, centerX + Math.Cos(((angle * i + angleOffset) * (Math.PI)) / 180) * textBigRadius - borderT.Width / 2);
borderT.SetValue(Canvas.TopProperty, centerY + Math.Sin(((angle * i + angleOffset) * (Math.PI)) / 180) * textBigRadius - borderT.Height / 2);
borderT.Text = $"{i + 1}";
borderT.TextAlignment = TextAlignment.Center;
borderT.FontSize = 27;
if (i == 0)
{
borderT.Foreground = new SolidColorBrush(SelectFontColor);
}
else
{
borderT.Foreground = new SolidColorBrush(DefaultFontColor);
}
Image operateBorder = new Image();
Panel.SetZIndex(operateBorder, 13);
this._canvas.Children.Add(operateBorder);
operateImageList.Add((i + 1), operateBorder);
operateBorder.Width = operateRadius * 2;
operateBorder.Height = operateRadius * 2;
operateBorder.SetValue(Canvas.LeftProperty, centerX + Math.Cos(((angle * i + angleOffset) * (Math.PI)) / 180) * operateBigRadius - operateBorder.Width / 2);
operateBorder.SetValue(Canvas.TopProperty, centerY + Math.Sin(((angle * i + angleOffset) * (Math.PI)) / 180) * operateBigRadius - operateBorder.Height / 2);
operateBorder.Visibility = Visibility.Collapsed;
Border imageBorder = new Border();
BackBorderList.Add(i + 1, imageBorder);
Panel.SetZIndex(imageBorder, 12);
this._canvas.Children.Add(imageBorder);
Image embryoImage = new Image();
picImageList.Add(i + 1, embryoImage);
imageBorder.Child = embryoImage;
int kk = 20;
embryoImage.Width = imageRadius * 2;
embryoImage.Height = imageRadius * 2;
EllipseGeometry ellipseGeometry = new EllipseGeometry(new Point(imageRadius, imageRadius), imageRadius - kk, imageRadius - kk);
embryoImage.SetValue(Image.ClipProperty, ellipseGeometry);
imageBorder.Tag = i;
imageBorder.Width = imageRadius * 2;
imageBorder.Height = imageRadius * 2;
imageBorder.SetValue(Canvas.LeftProperty, centerX + Math.Cos(((angle * i + angleOffset) * (Math.PI)) / 180) * imageBigRadius - imageBorder.Width / 2);
imageBorder.SetValue(Canvas.TopProperty, centerY + Math.Sin(((angle * i + angleOffset) * (Math.PI)) / 180) * imageBigRadius - imageBorder.Height / 2);
if (ExDishSource != null)
{
var itemEmbryo = SetWellImage(i + 1, 1);
if (itemEmbryo == null)
{
embryoImage.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailNoEmbryo.png", UriKind.Absolute));
}
else
{
embryoImage.Source = new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailNoEmbryo1.png", UriKind.Absolute));
}
}
else
{
imageBorder.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailNoEmbryoBackground.png", UriKind.Absolute)));
}
int index = i;
imageBorder.MouseDown += (s, e) =>
{
if (selectedIndex == index) return;
SelectIndex(index);
ChangeSelectdIndexEvent?.Invoke(index + 1);
};
}
}
public void NextEmbryo()
{
int index = selectedIndex;
if (index == 15)
{
index = 0;
}
else
{
index++;
}
SelectIndex(index);
ChangeSelectdIndexEvent?.Invoke(index + 1);
}
public void LastEmbryo()
{
int index = selectedIndex;
if (index == 0)
{
index = 15;
}
else
{
index--;
}
SelectIndex(index);
ChangeSelectdIndexEvent?.Invoke(index + 1);
}
private object lock1 = new object();
private ExEmbryo SetWellImage(int index, int oldIndex)
{
lock (lock1)
{
if (ExDishSource == null) return null;
Border imageBorder = BackBorderList[index];
//Image embryoImage = picImageList[index];
var itemEmbryo = ExDishSource.embryoList.FirstOrDefault(x => x.wellSn == index);
if (itemEmbryo == null)
{
if (index == oldIndex)
{
imageBorder.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoSelectedIcon.png", UriKind.Absolute)));
}
else
{
imageBorder.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailNoEmbryoBackground.png", UriKind.Absolute)));
}
return itemEmbryo;
}
string borderSource = null;
switch ((EmbryoState)itemEmbryo.state)
{
case EmbryoState.End:
case EmbryoState.None:
if (itemEmbryo.alarm == 1)
{
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState3Icon.png";
}
else
{
if (index == oldIndex)
{
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoSelectedIcon.png";
}
else
{
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoBackground.png";
}
}
break;
case EmbryoState.Freezing: //冷冻
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState1Icon.png";
break;
case EmbryoState.Transplant://移植
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState2Icon.png";
break;
case EmbryoState.Cancellation://作废
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState3Icon.png";
break;
case EmbryoState.Delete://删除
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState4Icon.png";
break;
}
imageBorder.Background = new ImageBrush(new BitmapImage(new Uri(borderSource, UriKind.Absolute)));
return itemEmbryo;
}
}
private void SelectIndex(int index)
{
TextBlockList[selectedIndex].Foreground = new SolidColorBrush(DefaultFontColor);
SetWellImage(selectedIndex + 1, 0);
selectedIndex = index;
var itemEmbryo = ExDishSource.embryoList.FirstOrDefault(x => x.wellSn == selectedIndex + 1);
if (itemEmbryo == null)
{
BackBorderList[selectedIndex + 1].Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoSelectedIcon.png", UriKind.Absolute)));
}
else
{
if ((itemEmbryo.state == (int)EmbryoState.End || itemEmbryo.state == (int)EmbryoState.None) && itemEmbryo.alarm == 0)
{
BackBorderList[selectedIndex + 1].Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoSelectedIcon.png", UriKind.Absolute)));
}
}
RotateTransform rotateTransform = this._sx.RenderTransform as RotateTransform;
if (rotateTransform == null)
rotateTransform = new RotateTransform();
rotateTransform.Angle = angle * index;
//this._sx.RenderTransformOrigin = new Point(0.5, 0);
this._sx.RenderTransform = rotateTransform;
//foreach (var item in TextBlockList)
//{
// item.Foreground = new SolidColorBrush(DefaultFontColor);
//}
TextBlockList[index].Foreground = new SolidColorBrush(SelectFontColor);
}
private void mediaElementPlayer_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
string ss = "";
}
private void _preview_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
string ss11 = "";
}
private void _canvas_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
string ss2 = "";
}
public ExDish ExDishSource
{
get { return (ExDish)GetValue(ExDishSourceProperty); }
set { SetValue(ExDishSourceProperty, value); }
}
// Using a DependencyProperty as the backing store for ExDishSource. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ExDishSourceProperty =
DependencyProperty.Register("ExDishSource", typeof(ExDish), typeof(CustomDishInfo), new PropertyMetadata(null, new PropertyChangedCallback(ExDishSourcePropertyChanged)));
private static void ExDishSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (!(d is CustomDishInfo source)) return;
if (source.DataContext == null) return;
if (e.NewValue == null)
{
source.SetDish(source, null);
return;
}
if (!(e.NewValue is ExDish exDish))
{
source.SetDish(source, null);
return;
}
if (!source.isInit)
{
source.isInit = true;
source.InitCustomNew();
}
source.SetDish(source, exDish);
foreach (var item in exDish.embryoList)
{
item.AlarmChangedEvent -= source.EmbryoAlarmEvent;
item.AlarmChangedEvent += source.EmbryoAlarmEvent;
}
return;
}
private void EmbryoAlarmEvent(int wellsn, int stateAlarm)
{
Dispatcher.Invoke(() => { SetWellImage(wellsn, selectedIndex + 1); });
}
private void SetDish(CustomDishInfo customDishInfo, ExDish exDish)
{
if (exDish == null)
{
foreach (var item in customDishInfo.operateImageList)
{
if (item.Value.Visibility != Visibility.Hidden)
{
item.Value.Visibility = Visibility.Hidden;
}
}
foreach (var item in picImageList)
{
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/ellipse_backgroud.png", UriKind.Relative));
}
return;
}
foreach (var item in customDishInfo.operateImageList)
{
var embryo = exDish.embryoList.FirstOrDefault(x => x.wellSn == item.Key);
if (embryo == null)
{
item.Value.Visibility = Visibility.Hidden;
continue;
}
item.Value.Visibility = Visibility.Visible;
EmbryoState state = (EmbryoState)embryo.state;
switch (state)
{
case EmbryoState.Freezing:
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/open_button_freezable.png", UriKind.Relative));//冷冻
break;
case EmbryoState.Transplant:
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/yz.png", UriKind.Relative));//移植
break;
case EmbryoState.Cancellation:
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/open_button_no.png", UriKind.Relative));//作废
break;
case EmbryoState.Delete:
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/menu_delete.png", UriKind.Relative));//作废
break;
default:
item.Value.Visibility = Visibility.Hidden;
break;
}
}
}
///
/// 设置胚胎状态
///
///
///
public void SetEmbryoState(int well, int embryoState, int alarm)
{
var item = operateImageList[well];
EmbryoState state = (EmbryoState)embryoState;
item.Visibility = Visibility.Visible;
switch (state)
{
case EmbryoState.Freezing:
item.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/open_button_freezable.png", UriKind.Relative));//冷冻
break;
case EmbryoState.Transplant:
item.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/yz.png", UriKind.Relative));//移植
break;
case EmbryoState.Cancellation:
item.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/open_button_no.png", UriKind.Relative));//作废
break;
case EmbryoState.Delete:
item.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/menu_delete.png", UriKind.Relative));//作废
break;
default:
item.Visibility = Visibility.Hidden;
break;
}
string borderSource = null;
switch ((EmbryoState)embryoState)
{
case EmbryoState.End:
case EmbryoState.None:
if (alarm == 0)
{
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoSelectedIcon.png";
}
else
{
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState3Icon.png";
}
break;
case EmbryoState.Freezing: //冷冻
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState1Icon.png";
break;
case EmbryoState.Transplant://移植
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState2Icon.png";
break;
case EmbryoState.Cancellation://作废
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState3Icon.png";
break;
case EmbryoState.Delete://删除
borderSource = "pack://application:,,,/ivf_tl_Operate;component/Resources/Image/pc_DetailEmbryoState4Icon.png";
break;
}
BackBorderList[well].Background = new ImageBrush(new BitmapImage(new Uri(borderSource, UriKind.Absolute)));
}
///
/// 设置缩略图
///
///
public void SetEmbryoPic(List datas)
{
foreach (var item in picImageList)
{
var embryo = ExDishSource.embryoList.FirstOrDefault(x => x.wellSn == item.Key);
if (embryo == null)
{
item.Value.Tag = 0;
//item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/ellipse_backgroud.png", UriKind.Relative));
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/pc_DetailNoEmbryo.png", UriKind.Relative));
continue;
}
var currentData = datas.FirstOrDefault(x => x.wellSn == embryo.wellSn);
if (currentData == null || currentData.lastPicture == null)
{
item.Value.Tag = 0;
//item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/ellipse_noembryo.png", UriKind.Relative));
item.Value.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/DetailEmbryoNoPic.png", UriKind.Relative));
}
else
{
item.Value.Tag = 1;
item.Value.Source = AppData.Instance.ConvertHelper.StringToBitmapImage($"{AppData.Instance.BaseUrl}{currentData.lastPicture.Replace(AppData.Instance.PicSuf, $"_214x214{AppData.Instance.PicSuf}")}?token={AppData.Instance.HttpHelper.GetToken()}");
}
//if (item.Value.Parent is Border parentBorder)
// parentBorder.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/ivf_tl_Operate;component/Resources/Image/ellipse_backgroud.png", UriKind.Absolute)));
}
}
public void SetPreview(DishPicAndVideo dishPicAndVideo)
{
this.Cancas_Preview.Visibility = Visibility.Visible;
this.TextBlock_Preview.Text = "";
if (dishPicAndVideo == null || string.IsNullOrEmpty(dishPicAndVideo.lastPicture))
{
//this._preview.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/video_preview.png", UriKind.Relative));
AppData.Instance.SetImageSource(this._preview, LogoEnum.BlackCircle);
return;
}
this._preview.Source = AppData.Instance.ConvertHelper.StringToBitmapImage($"{AppData.Instance.BaseUrl}{dishPicAndVideo.lastPicture}?token={AppData.Instance.HttpHelper.GetToken()}");
}
public void SetPreviewNoVideo()
{
this.Cancas_Preview.Visibility = Visibility.Visible;
this._preview.Source = new BitmapImage(new Uri("/ivf_tl_Operate;component/Resources/Image/none_video.png", UriKind.Relative));
this.TextBlock_Preview.Text = KeyToStringConvert.GetLanguageStringByKey("C0287");
}
bool isMax = false;
double maxWidth = 1583;
double minWidth = 840;
double maxLeft = 0;
double minLeft = 371.5;
private void PreviewMouseDownEvent(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2)
{
if (isMax == false)
{
isMax = true;
mask.Width = maxWidth;
mask.Height = maxWidth;
//Image_Load.Width= maxWidth;
//Image_Load.Height= maxWidth;
mediaElementPlayer.Width = maxWidth;
mediaElementPlayer.Height = maxWidth;
//_preview.Width = maxWidth;
//_preview.Height = maxWidth;
Canvas.SetLeft(mask, maxLeft);
Canvas.SetTop(mask, maxLeft);
//Canvas.SetLeft(Image_Load, maxLeft);
//Canvas.SetTop(Image_Load, maxLeft);
//Image_Load.SetValue(Panel.ZIndexProperty, 15);
Canvas.SetLeft(mediaElementPlayer, maxLeft);
Canvas.SetTop(mediaElementPlayer, maxLeft);
mediaElementPlayer.SetValue(Panel.ZIndexProperty, 16);
//Canvas.SetLeft(_preview, maxLeft);
//Canvas.SetTop(_preview, maxLeft);
//_preview.SetValue(Panel.ZIndexProperty, 17);
}
else
{
isMax = false;
mask.Width = minWidth;
mask.Height = minWidth;
//Image_Load.Width = minWidth;
//Image_Load.Height = minWidth;
mediaElementPlayer.Width = minWidth;
mediaElementPlayer.Height = minWidth;
//_preview.Width = minWidth;
//_preview.Height = minWidth;
Canvas.SetLeft(mask, minLeft);
Canvas.SetTop(mask, minLeft);
//Canvas.SetLeft(Image_Load, minLeft);
//Canvas.SetTop(Image_Load, minLeft);
//Image_Load.SetValue(Panel.ZIndexProperty, 7);
Canvas.SetLeft(mediaElementPlayer, minLeft);
Canvas.SetTop(mediaElementPlayer, minLeft);
mediaElementPlayer.SetValue(Panel.ZIndexProperty, 8);
//Canvas.SetLeft(_preview, minLeft);
//Canvas.SetTop(_preview, minLeft);
//_preview.SetValue(Panel.ZIndexProperty, 9);
}
mask.CornerRadius = new CornerRadius(Width / 2);
SetLoad(isMax);
SetPreView(isMax);
IsMaxChangedEvent?.Invoke(isMax);
e.Handled = true;
}
}
private void SetPreView(bool ismax)
{
if (ismax)
{
_preview.Width = maxWidth;
_preview.Height = maxWidth;
Cancas_Preview.Width = maxWidth;
Cancas_Preview.Height = maxWidth;
TextBlock_Preview.Width = maxWidth;
TextBlock_Preview.FontSize = 98;
Canvas.SetTop(TextBlock_Preview, 958);
Canvas.SetLeft(Cancas_Preview, maxLeft);
Canvas.SetTop(Cancas_Preview, maxLeft);
Cancas_Preview.SetValue(Panel.ZIndexProperty, 17);
}
else
{
_preview.Width = minWidth;
_preview.Height = minWidth;
Cancas_Preview.Width = minWidth;
Cancas_Preview.Height = minWidth;
TextBlock_Preview.Width = minWidth;
TextBlock_Preview.FontSize = 50;
Canvas.SetTop(TextBlock_Preview, 512);
Canvas.SetLeft(Cancas_Preview, minLeft);
Canvas.SetTop(Cancas_Preview, minLeft);
Cancas_Preview.SetValue(Panel.ZIndexProperty, 9);
}
}
private void SetLoad(bool ismax)
{
if (ismax)
{
Image_Load.Width = maxWidth;
Image_Load.Height = maxWidth;
Cancas_Load.Width = maxWidth;
Cancas_Load.Height = maxWidth;
TextBlock_Load.Width = maxWidth;
TextBlock_Load.FontSize = 98;
Canvas.SetTop(TextBlock_Load, 958);
Canvas.SetLeft(Cancas_Load, maxLeft);
Canvas.SetTop(Cancas_Load, maxLeft);
Cancas_Load.SetValue(Panel.ZIndexProperty, 15);
}
else
{
Image_Load.Width = minWidth;
Image_Load.Height = minWidth;
Cancas_Load.Width = minWidth;
Cancas_Load.Height = minWidth;
TextBlock_Load.Width = minWidth;
TextBlock_Load.FontSize = 50;
Canvas.SetTop(TextBlock_Load, 512);
Canvas.SetLeft(Cancas_Load, minLeft);
Canvas.SetTop(Cancas_Load, minLeft);
Cancas_Load.SetValue(Panel.ZIndexProperty, 7);
}
}
}
}