示例#1
0
        /// <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;
            }
        }
示例#2
0
        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;
            }
        }
示例#3
0
        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;
            }
        }
示例#4
0
        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;
                }
            }
        }