コード例 #1
0
 private void editButton_Click(object sender, RoutedEventArgs e)
 {
     if (myDataGrid.SelectedItem == null)
     {
         MessageBox.Show("Choose an item to edit", "Edit an item", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
     else
     {
         StockItemWindow w = new StockItemWindow();
         w.ItemToEdit = (StockEntryViewModel)myDataGrid.SelectedItem;
         w.InitEditForm();
         w.ShowDialog();
     }
 }
コード例 #2
0
        private void addButton_Click(object sender, RoutedEventArgs e)
        {
            StockItemWindow w = new StockItemWindow();

            w.ShowDialog();
        }