using DataEntity.Share;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
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;
|
using XHandler.Class;
|
using XHandler.View.Consumables;
|
using XHandler.View.ManualCoating;
|
using XImagingXhandler.XDAL;
|
|
namespace XHandler.View.ManualPick
|
{
|
public class DataFillInfo
|
{
|
public int column { get; set; }
|
public string columnName { get; set; }
|
public string columnContent { get; set; }
|
public int nFrom { get; set; }
|
public int nTo { get; set; }
|
public List<int> rows { get; set; }
|
public DataFillInfo()
|
{
|
nFrom = 1;
|
nTo = 1;
|
rows = new List<int>();
|
}
|
}
|
|
/// <summary>
|
/// DataFillItems.xaml 的交互逻辑
|
/// </summary>
|
public partial class DataFillItems : Window
|
{
|
#region custom event
|
public event EventHandler closeEvent;
|
|
/// <summary>
|
/// 确定
|
/// </summary>
|
public static readonly RoutedEvent OKRoutedEvent =
|
EventManager.RegisterRoutedEvent("OKEvent", RoutingStrategy.Bubble, typeof(CustomEvent.CustomRoutedEventHandler<DataFillInfo>), typeof(DataFillTips));
|
|
[Description("OKEvent")]
|
public event CustomEvent.CustomRoutedEventHandler<DataFillInfo> OKEvent
|
{
|
add
|
{
|
this.AddHandler(OKRoutedEvent, value);
|
}
|
remove
|
{
|
this.RemoveHandler(OKRoutedEvent, value);
|
}
|
}
|
|
private void RaiseOKEvent(DataFillInfo info)
|
{
|
CustomRoutedEventArgs<DataFillInfo> arg = new CustomRoutedEventArgs<DataFillInfo>(OKRoutedEvent, info);
|
this.RaiseEvent(arg);
|
}
|
#endregion
|
|
public DataFillInfo dataFillInfo { get; set; }
|
public CutSetting cutSetting = null;
|
|
public DataFillItems(DataFillInfo info)
|
{
|
InitializeComponent();
|
dataFillInfo = info;
|
texblockName.Text = dataFillInfo.columnName;
|
textBoxName.Text = dataFillInfo.columnContent;
|
if (dataFillInfo.rows.Count > 0)
|
{
|
textBoxNoFrom.Text = dataFillInfo.nFrom.ToString();
|
textBoxNoTo.Text = dataFillInfo.nTo.ToString();
|
}
|
this.Owner = (Window)Shared.Main;
|
}
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
{
|
if (EventResponseController.Instance.CanExecute() == false)
|
return;
|
|
closeEvent?.Invoke(this, EventArgs.Empty);
|
this.Close();
|
}
|
|
private void btnOk_Click(object sender, RoutedEventArgs e)
|
{
|
if (EventResponseController.Instance.CanExecute() == false)
|
return;
|
dataFillInfo.columnContent = textBoxName.Text.Trim();
|
int nForm = 1, nTo = 1;
|
|
int.TryParse(textBoxNoFrom.Text.Trim(), out nForm);
|
int.TryParse(textBoxNoTo.Text.Trim(), out nTo);
|
|
dataFillInfo.nFrom = nForm;
|
dataFillInfo.nTo = nTo;
|
|
//RaiseOKEvent(dataFillInfo);
|
if (cutSetting != null)
|
{
|
cutSetting.DataFillTips_OKEvent();
|
this.Close();
|
}
|
}
|
|
#region 拖动窗体
|
/// <summary>
|
/// 拖动窗体
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
|
{
|
if (e.ChangedButton == MouseButton.Left)
|
{
|
this.DragMove();
|
}
|
}
|
#endregion
|
}
|
}
|