/// <summary> /// The event handler for the Languages changed /// </summary> /// <param name="dependencyObject"></param> /// <param name="e"></param> private static void OnLanguagesPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { CustomerExpander userControl = dependencyObject as CustomerExpander; if (userControl != null) { userControl.languagesCombox.ItemsSource = (IEnumerable <string>)e.NewValue; } }
private static void OnDescriptionPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { CustomerExpander userControl = dependencyObject as CustomerExpander; string newValue = e.NewValue as string; if (userControl != null && newValue != userControl.descriptionTextBox.Text) { userControl.descriptionTextBox.Text = newValue; } }
private static void OnSelectedItemPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { CustomerExpander userControl = dependencyObject as CustomerExpander; string newValue = e.NewValue as string; if (userControl != null && newValue != userControl.languagesCombox.SelectedItem as string) { userControl.languagesCombox.SelectedItem = newValue; } }
private static void OnIsDefaultEnglishPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { CustomerExpander userControl = dependencyObject as CustomerExpander; if (userControl != null) { bool isEnglish = (bool)e.NewValue; if (isEnglish) { userControl.englishTxtblock.Visibility = Visibility.Visible; userControl.deleteTextBlock.Visibility = Visibility.Collapsed; userControl.languagesCombox.Visibility = Visibility.Collapsed; } else { userControl.englishTxtblock.Visibility = Visibility.Collapsed; userControl.languagesCombox.Visibility = Visibility.Visible; } } }