Ejemplo n.º 1
0
        ///<summary>
        /// The event when the Text blank message change its value
        /// </summary>
        static void OnFases_Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            PowerSelector ctrl  = sender as PowerSelector;
            int           fases = (int)e.NewValue;

            CollectionViewSource.GetDefaultView(ctrl.cboHP.ItemsSource).Refresh();
            if (ctrl.cboHP.Items.Count > 0)
            {
                ctrl.cboHP.SelectedIndex = 0;
            }
        }
Ejemplo n.º 2
0
        ///<summary>
        /// The event when the Text blank message change its value
        /// </summary>
        static void OnPower_Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            PowerSelector ctrl = sender as PowerSelector;
            PowerType     ptp  = (PowerType)e.NewValue;

            if (ptp == PowerType.HP)
            {
                ctrl.Watts.Visibility = Visibility.Collapsed;
                ctrl.Hp.Visibility    = Visibility.Visible;
            }
            else
            {
                ctrl.Watts.Visibility = Visibility.Visible;
                ctrl.Hp.Visibility    = Visibility.Collapsed;
                if (ptp == PowerType.Watts)
                {
                    ctrl.wattsInput.IsChecked = true;
                }
                else
                {
                    ctrl.wattsInput.IsChecked = false;
                }
            }
        }