//Fill the Inner Category ComboBox with relative values private void FillInnerCategory() { GuiChanges.FillComboWithInnerCategory(cmbInnerCat, cmbBaseCat.SelectedItem); cmbInnerCat.SelectedItem = CurrentItem.InnerCategory; if (cmbInnerCat.SelectedIndex < 0) { cmbInnerCat.SelectedIndex++; } }
//Fills the Inner Category ComboBox or hides it - //depending on user input private void FillInner() { //Creating an array for easy hiding and showing //the Inner Category controls UIElement[] inner = { lblInnerCategory, cmbInnerCategory }; //If there's any choice from the User on the Base Category ComboBox if (cmbBaseCategory.SelectedItem != null) { //Then fill the Inner Category ComboBox GuiChanges.FillComboWithInnerCategory (cmbInnerCategory, cmbBaseCategory.SelectedItem); //And show the Inner ComboBox to the user GuiChanges.Show(inner); } //If there's no choice from the User on Base Category ComboBox else { //if so - hide the Inner Category ComboBox GuiChanges.Hide(inner); } }
//Fills inner category relative to base that user chooses //and enables the combo for Inner private void FillInnerCombo(object sender, SelectionChangedEventArgs e) { GuiChanges.Enable(cmbInnerCat); GuiChanges.FillComboWithInnerCategory(cmbInnerCat, cmbBaseCat.SelectedItem); cmbInnerCat.SelectedIndex = 0; }