/// <summary> /// 添加阅览室 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void addroom_Click(object sender, RoutedEventArgs e) { ReadingRoom r = new ReadingRoom(); r.BindingData(); r.ShowDialog(); BindingData(); }
/// <summary> /// 编辑阅览室 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void editroom_Click(object sender, RoutedEventArgs e) { if (roombox.SelectedIndex < 0) { MessageBox.Show("请先选择一个项目!"); } else { ReadingRoom r = new ReadingRoom(); r.viewModel.ReadingRoomModel = (roombox.SelectedItem as ViewModel.ViewModel_ReadingRoom).ReadingRoomModel; r.viewModel.IsEdit = true; r.BindingData(); r.ShowDialog(); BindingData(); } }