12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System.Windows;
- using System.Windows.Controls;
- using TrayBarcodeManagement.Model;
- using TrayBarcodeManagement.ViewModel;
- namespace TrayBarcodeManagement.View
- {
- /// <summary>
- /// TrayBarcodeView.xaml 的交互逻辑
- /// </summary>
- public partial class TrayBarcodeView : UserControl
- {
- public TrayBarcodeView()
- {
- InitializeComponent();
- }
- private void ExitButton_Click(object sender, RoutedEventArgs e)
- {
- Application.Current.Shutdown();
- }
- private void MaxButton_Click(object sender, RoutedEventArgs e)
- {
- if (Application.Current.MainWindow.WindowState == WindowState.Normal)
- {
- Application.Current.MainWindow.WindowState = WindowState.Maximized;
- }
- else
- {
- Application.Current.MainWindow.WindowState = WindowState.Normal;
- }
- }
- private void MinButton_Click(object sender, RoutedEventArgs e)
- {
- Application.Current.MainWindow.WindowState = WindowState.Minimized;
- }
- private void AddButton_Click(object sender, RoutedEventArgs e)
- {
- DetailTrayBarcodeView detailTrayBarcodeView = new DetailTrayBarcodeView();
- detailTrayBarcodeView.DataContext = new DetailTrayBarcodeViewModel(new TrayBarcodeModel(), false);
- detailTrayBarcodeView.Show();
- }
- private void DataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- TrayBarcodeViewModel trayBarcodeViewModel = this.DataContext as TrayBarcodeViewModel;
- DetailTrayBarcodeView detailTrayBarcodeView = new DetailTrayBarcodeView();
- detailTrayBarcodeView.DataContext = new DetailTrayBarcodeViewModel(trayBarcodeViewModel.TrayBarcodeModel, true);
- detailTrayBarcodeView.Show();
- }
- }
- }
|