38 lines
901 B
C#
38 lines
901 B
C#
using System.Windows;
|
|
|
|
namespace DrillTools
|
|
{
|
|
/// <summary>
|
|
/// ToolDetailWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class ToolDetailWindow : Window
|
|
{
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
public ToolDetailWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 使用指定的刀具初始化窗口
|
|
/// </summary>
|
|
/// <param name="tool">刀具对象</param>
|
|
public ToolDetailWindow(ToolItem tool) : this()
|
|
{
|
|
if (DataContext is ToolDetailViewModel viewModel)
|
|
{
|
|
viewModel.Tool = tool;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 关闭按钮点击事件
|
|
/// </summary>
|
|
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
} |