using DataEntity;
|
using DataEntity.Share;
|
using DataRWDAL;
|
using Newtonsoft.Json.Linq;
|
using System;
|
using System.Collections.Generic;
|
using System.Collections.ObjectModel;
|
using System.IO;
|
using System.Windows;
|
using System.Windows.Controls;
|
using System.Windows.Input;
|
using System.Windows.Media.Animation;
|
using System.Windows.Media.Media3D;
|
using XCommon.Log;
|
using XCoreBLL;
|
using XHandler.Class;
|
using XHandler.Class.DataEx;
|
using XImagingXhandler.XDAL;
|
|
namespace XHandler.View.BacteriaPickResult
|
{
|
/// <summary>
|
/// 涂布报告页面
|
/// </summary>
|
public partial class BacteriaCoatingDetails : UserControl
|
{
|
#region 变量
|
/// <summary>
|
/// 实验挑菌信息
|
/// </summary>
|
private ExperimentRunChoiceBacteraModel experimentRunChoiceBactera = null;
|
/// <summary>
|
/// 挑选涂布详细信息集合
|
/// </summary>
|
private List<ExperimentRunDetailModel> experimentRunDetailList = null;
|
public event EventHandler closeEvent = null;
|
#endregion
|
|
#region 初始化
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="expRunChoiceBactera">挑菌拍照基本信息</param>
|
public BacteriaCoatingDetails(ExperimentRunChoiceBacteraModel expRunChoiceBactera)
|
{
|
InitializeComponent();
|
experimentRunChoiceBactera = expRunChoiceBactera;
|
this.DataContext = experimentRunChoiceBactera;
|
|
// 获取挑选涂布详细信息集合
|
experimentRunDetailList = ExperimentRunDetailDB.GetList(expRunChoiceBactera.ExperimentId, expRunChoiceBactera.RunChoiceBacteraId);
|
dgPickData.ItemsSource = experimentRunDetailList;
|
}
|
|
/// <summary>
|
/// 初期化
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
{
|
//Storyboard storyboard = new Storyboard();
|
//DoubleAnimation doubleAnimation = new DoubleAnimation(0, 1300, new Duration(TimeSpan.FromSeconds(0.25)));
|
//Storyboard.SetTarget(doubleAnimation, border);//Target对象
|
//Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("Width"));//Target属性
|
//storyboard.Children.Add(doubleAnimation);
|
//ObjectAnimationUsingKeyFrames showAnimation = new ObjectAnimationUsingKeyFrames();
|
//showAnimation.BeginTime = TimeSpan.FromSeconds(0);
|
//Storyboard.SetTarget(showAnimation, this);
|
//Storyboard.SetTargetProperty(showAnimation, new PropertyPath("(UIElement.Visibility)"));
|
//DiscreteObjectKeyFrame closeKeyFrame = new DiscreteObjectKeyFrame(Visibility.Visible, TimeSpan.FromSeconds(0.01));
|
//showAnimation.KeyFrames.Add(closeKeyFrame);
|
//storyboard.Children.Add(showAnimation);
|
|
//storyboard.Begin();
|
|
|
this.Width = Shared.Config.DisplaySizeW;
|
this.Height = Shared.Config.DisplaySizeH;
|
}
|
#endregion
|
|
#region 窗口关闭
|
/// <summary>
|
/// 窗口关闭
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void btnClose_Click(object sender, RoutedEventArgs e)
|
{
|
if (EventResponseController.Instance.CanExecute() == false)
|
return;
|
|
//Storyboard storyboard = new Storyboard();
|
//DoubleAnimation doubleAnimation = new DoubleAnimation(1300, 0, new Duration(TimeSpan.FromSeconds(0.25)));
|
//Storyboard.SetTarget(doubleAnimation, border);//Target对象
|
//Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("Width"));//Target属性
|
//storyboard.Children.Add(doubleAnimation);
|
//ObjectAnimationUsingKeyFrames showAnimation = new ObjectAnimationUsingKeyFrames();
|
//showAnimation.BeginTime = TimeSpan.FromSeconds(0);
|
//Storyboard.SetTarget(showAnimation, this);
|
//Storyboard.SetTargetProperty(showAnimation, new PropertyPath("(UIElement.Visibility)"));
|
//DiscreteObjectKeyFrame closeKeyFrame = new DiscreteObjectKeyFrame(Visibility.Collapsed, TimeSpan.FromSeconds(0.26));
|
//showAnimation.KeyFrames.Add(closeKeyFrame);
|
//storyboard.Children.Add(showAnimation);
|
//storyboard.Completed += delegate { closeEvent?.Invoke(this, EventArgs.Empty); };
|
//storyboard.Begin();
|
|
closeEvent?.Invoke(this, EventArgs.Empty);
|
}
|
#endregion
|
|
#region 导出报告
|
/// <summary>
|
/// 导出报告
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void btnExport_Click(object sender, RoutedEventArgs e)
|
{
|
}
|
#endregion
|
|
#region 原图预览
|
/// <summary>
|
/// 原图预览
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void SrcImage_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
{
|
if (e.ClickCount > 1)
|
{
|
ImagePreview imagePreview = new ImagePreview(experimentRunChoiceBactera.SourceImagePath);
|
imagePreview.closeEvent += ImagePreview_closeEvent;
|
Window wnd = Application.Current.MainWindow;
|
Grid parent = Utilities.FindVisualChild<Grid>(wnd);
|
parent.Children.Add(imagePreview);
|
}
|
}
|
|
/// <summary>
|
/// 预览窗口关闭
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void ImagePreview_closeEvent(object sender, EventArgs e)
|
{
|
// 移除元素
|
UIElement element = sender as UIElement;
|
Utilities.RemoveChild(element);
|
}
|
#endregion
|
|
#region 挑菌后的图片预览
|
/// <summary>
|
/// 挑菌后的图片预览
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void Image_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
{
|
if (e.ClickCount > 1)
|
{
|
ImagePreview imagePreview = new ImagePreview(experimentRunChoiceBactera.UpdateImagePath);
|
imagePreview.closeEvent += ImagePreview_closeEvent;
|
Window wnd = Application.Current.MainWindow;
|
Grid parent = Utilities.FindVisualChild<Grid>(wnd);
|
parent.Children.Add(imagePreview);
|
}
|
}
|
#endregion
|
}
|
}
|