private void EditItemBtn_Click(object sender, RoutedEventArgs e) { var temp = this.AllMedicineList.SelectedItem as CommContracts.Medicine; if (temp == null) { return; } // 新增药品 var window = new Window(); EditMedicineView eidtMedicine = new EditMedicineView(temp); window.Content = eidtMedicine; window.Width = 400; window.Height = 500; //window.ResizeMode = ResizeMode.NoResize; bool?bResult = window.ShowDialog(); if (bResult.Value) { MessageBox.Show("药品修改完成!"); UpdateAllDate(); } }
private void NewItemBtn_Click(object sender, RoutedEventArgs e) { // 新增药品 var window = new Window(); EditMedicineView eidtMedicine = new EditMedicineView(); window.Content = eidtMedicine; window.Width = 400; window.Height = 500; //window.ResizeMode = ResizeMode.NoResize; window.WindowStartupLocation = WindowStartupLocation.CenterOwner; bool?bResult = window.ShowDialog(); if (bResult.Value) { MessageBox.Show("药品新建完成!"); UpdateAllDate(); } }