private void ModifyCurrent(object sender, RoutedEventArgs e) { if (SelectedItem.GetType().Name == SelectedFaculty.GetType().Name) { InputPage ip = new InputPage((FacultyViewModel)SelectedItem, "Modify"); ip.Owner = this; ip.Resources["BorderColor"] = Resources["BorderColor"]; ip.Resources["ButtonColor"] = Resources["ButtonColor"]; ip.Resources["BGColor"] = Resources["BGColor"]; ip.Resources["TextColor"] = Resources["TextColor"]; ip.Resources["FontStyle"] = Resources["FontStyle"]; ip.Resources["FontFamily"] = Resources["FontFamily"]; ip.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; ip.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; ip.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; ip.Show(); TreeViewAll.ItemsSource = null; TreeViewAll.ItemsSource = CollectionView; } if (SelectedItem.GetType().Name == SelectedGroup.GetType().Name) { InputPage ip = new InputPage((GroupViewModel)SelectedItem, "Modify"); ip.Owner = this; ip.Resources["BorderColor"] = Resources["BorderColor"]; ip.Resources["ButtonColor"] = Resources["ButtonColor"]; ip.Resources["BGColor"] = Resources["BGColor"]; ip.Resources["TextColor"] = Resources["TextColor"]; ip.Resources["FontStyle"] = Resources["FontStyle"]; ip.Resources["FontFamily"] = Resources["FontFamily"]; ip.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; ip.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; ip.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; ip.Show(); TreeViewAll.ItemsSource = null; TreeViewAll.ItemsSource = CollectionView; } if (SelectedItem.GetType().Name == SelectedStudent.GetType().Name) { SelectedStudent = (StudentViewModel)SelectedItem; StudentInput si = new StudentInput((StudentViewModel)SelectedItem); si.Owner = this; si.Resources["BorderColor"] = Resources["BorderColor"]; si.Resources["ButtonColor"] = Resources["ButtonColor"]; si.Resources["BGColor"] = Resources["BGColor"]; si.Resources["TextColor"] = Resources["TextColor"]; si.Resources["FontStyle"] = Resources["FontStyle"]; si.Resources["FontFamily"] = Resources["FontFamily"]; si.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; si.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; si.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; si.Show(); TreeViewAll.ItemsSource = null; TreeViewAll.ItemsSource = CollectionView; } }
private void Add(object sender, RoutedEventArgs e) { if (SelectedItem == null) { InputPage ip = new InputPage(new FacultyViewModel(), "Add"); ip.Owner = this; ip.Resources["BorderColor"] = Resources["BorderColor"]; ip.Resources["ButtonColor"] = Resources["ButtonColor"]; ip.Resources["BGColor"] = Resources["BGColor"]; ip.Resources["TextColor"] = Resources["TextColor"]; ip.Resources["FontStyle"] = Resources["FontStyle"]; ip.Resources["FontFamily"] = Resources["FontFamily"]; ip.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; ip.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; ip.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; ip.Show(); TreeViewAll.ItemsSource = null; TreeViewAll.ItemsSource = CollectionView; Delete_All_Button.IsEnabled = true; Delete_All_Button.Opacity = 1; return; } if (SelectedItem.GetType().Name == SelectedFaculty.GetType().Name) { SelectedFaculty = (FacultyViewModel)SelectedItem; InputPage ip = new InputPage(new GroupViewModel() { Parent = SelectedFaculty }, "Add"); ip.Owner = this; ip.Resources["BorderColor"] = Resources["BorderColor"]; ip.Resources["ButtonColor"] = Resources["ButtonColor"]; ip.Resources["BGColor"] = Resources["BGColor"]; ip.Resources["TextColor"] = Resources["TextColor"]; ip.Resources["FontStyle"] = Resources["FontStyle"]; ip.Resources["FontFamily"] = Resources["FontFamily"]; ip.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; ip.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; ip.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; ip.Show(); TreeViewAll.ItemsSource = null; TreeViewAll.ItemsSource = CollectionView; return; } if (SelectedItem.GetType().Name == SelectedGroup.GetType().Name) { SelectedGroup = (GroupViewModel)SelectedItem; StudentInput si = new StudentInput("Add new student to group \"" + SelectedGroup.Name + "\""); si.Owner = this; si.Resources["BorderColor"] = Resources["BorderColor"]; si.Resources["ButtonColor"] = Resources["ButtonColor"]; si.Resources["BGColor"] = Resources["BGColor"]; si.Resources["TextColor"] = Resources["TextColor"]; si.Resources["FontStyle"] = Resources["FontStyle"]; si.Resources["FontFamily"] = Resources["FontFamily"]; si.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; si.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; si.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; si.Show(); TreeViewAll.ItemsSource = null; TreeViewAll.ItemsSource = CollectionView; return; } if (SelectedItem.GetType().Name == SelectedStudent.GetType().Name) { SelectedStudent = (StudentViewModel)SelectedItem; Info si = new Info(SelectedStudent); si.Resources["BorderColor"] = Resources["BorderColor"]; si.Resources["ButtonColor"] = Resources["ButtonColor"]; si.Resources["BGColor"] = Resources["BGColor"]; si.Resources["TextColor"] = Resources["TextColor"]; si.Resources["FontStyle"] = Resources["FontStyle"]; si.Resources["FontFamily"] = Resources["FontFamily"]; si.Resources["FontSizeSmall"] = Resources["FontSizeSmall"]; si.Resources["FontSizeMedium"] = Resources["FontSizeMedium"]; si.Resources["FontSizeLarge"] = Resources["FontSizeLarge"]; si.Show(); return; } }