private void openItemDish(WindowNewDishItem item) { DataRowView dataRow = (DataRowView)TabControl_Dishes_TabItem_DishData_Grid.SelectedItem; try { item.setName(dataRow.Row.ItemArray[0].ToString()); if (dataRow.Row.ItemArray[1] != null) { item.setIngredients(dataRow.Row.ItemArray[1].ToString()); } if (dataRow.Row.ItemArray[2] != null) { item.setSpicesMatchings(dataRow.Row.ItemArray[2].ToString()); } if (dataRow.Row.ItemArray[3] != null) { item.setWinesMatchings(dataRow.Row.ItemArray[3].ToString()); } item.setEditModeVariant(); item.setParent(this); item.Height = 2 * MainWindow.ActualHeight / 3; item.Width = MainWindow.ActualWidth / 2; item.ShowDialog(); } catch (NullReferenceException nullReference) { System.Windows.MessageBox.Show(options.language.MainPage_ChooseDatagridPossition()); } }
private void TabControl_Dishes_TabItem_ButtonsPanel_Grid_ShowDetails_Button_Click(object sender, RoutedEventArgs e) { WindowNewDishItem viewDishItem = new WindowNewDishItem(false, options); openItemDish(viewDishItem); }