Example #1
0
 internal void RaiseUnchecked(RoutedEventArgs args)
 {
     if ((ButtonType == ButtonTypes.Toggle) && !IsFullScreen)
     {
         Unchecked?.Invoke(this, args);
     }
 }
Example #2
0
        private void ToggleButton_PropertyChanged(object sender, AvaloniaPropertyChangedEventArgs e)
        {
            if (e.Property.Name == nameof(ToggleButton.IsChecked))
            {
                if ((bool)e.NewValue)
                {
                    var command          = this.CheckedCommand;
                    var commandParameter = this.CheckedCommandParameter ?? this;
                    if (command != null && command.CanExecute(commandParameter))
                    {
                        command.Execute(commandParameter);
                    }

                    Checked?.Invoke(this, new RoutedEventArgs());
                }
                else
                {
                    var command          = this.UnCheckedCommand;
                    var commandParameter = this.UnCheckedCommandParameter ?? this;
                    if (command != null && command.CanExecute(commandParameter))
                    {
                        command.Execute(commandParameter);
                    }

                    Unchecked?.Invoke(this, new RoutedEventArgs());
                }
            }
        }
        public override void OnMouseUp(MouseEventArgs e)
        {
            if (Enabled && Pressed)
            {
                if (InteractiveBounds.Contains(e.Position))
                {
                    Pressed = false;
                    if (IsChecked)
                    {
                        IsChecked = false;
                        UpdateStyle();
                        Unchecked?.Invoke(this, EventArgs.Empty);
                        return;
                    }

                    if (!IsChecked)
                    {
                        IsChecked = true;
                        UpdateStyle();
                        Checked?.Invoke(this, EventArgs.Empty);
                        return;
                    }
                }
            }
        }
Example #4
0
 private void CheckBoxUnChecked(object sender, RoutedEventArgs e)
 {
     if (Unchecked != null)
     {
         Unchecked.Invoke(DataContext, e);
     }
 }
Example #5
0
 protected virtual void OnIsCheckedChanged(bool?oldValue, bool?newValue)
 {
     if (newValue.HasValue && newValue.Value)
     {
         Checked?.Invoke(this, new RoutedEventArgs());
     }
     else
     {
         Unchecked?.Invoke(this, new RoutedEventArgs());
     }
 }
Example #6
0
 void Notify(bool val)
 {
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsChecked"));
     if (val)
     {
         Checked?.Invoke();
     }
     else
     {
         Unchecked?.Invoke();
     }
 }
Example #7
0
        private protected virtual void OnUnchecked()
        {
            UpdateVisualState();

            // Create the args
            var args = new RoutedEventArgs();

            args.OriginalSource = this;

            // Raise the event
            Unchecked?.Invoke(this, args);
        }
Example #8
0
        private void UncheckedHandler(object sender, RoutedEventArgs e)
        {
            var command          = this.UnCheckedCommand;
            var commandParameter = this.UnCheckedCommandParameter ?? this;

            if (command != null && command.CanExecute(commandParameter))
            {
                command.Execute(commandParameter);
            }

            Unchecked?.Invoke(this, e);
        }
Example #9
0
 private void ToggleButton_OnClick(object sender, RoutedEventArgs e)
 {
     if (ToggleButton.IsChecked.Value)
     {
         AutoCloseNotificationBar.Show(CheckedMessage);
         Checked?.Invoke(this, null);
         ToggleButton.ToolTip = CheckedTooltip;
     }
     else
     {
         AutoCloseNotificationBar.Show(UncheckedMessage);
         Unchecked?.Invoke(this, null);
         ToggleButton.ToolTip = UncheckedTooltip;
     }
 }
        private void ToggleGrid_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (checkbox.IsChecked == true)
            {
                checkbox.IsChecked = false;
                IsChecked          = false;
                Unchecked?.Invoke(this, EventArgs.Empty);
            }
            else
            {
                checkbox.IsChecked = true;
                IsChecked          = true;
                Checked?.Invoke(this, EventArgs.Empty);
            }

            StateChanged?.Invoke(this, EventArgs.Empty);
        }
 protected void InvokeUnchecked(RoutedEventArgs e)
 {
     Unchecked?.Invoke(this, e);
 }
 internal void RaiseUnchecked(RoutedEventArgs args)
 {
     Unchecked?.Invoke(this, args);
 }
Example #13
0
 private void UwpControl_Unchecked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     Unchecked?.Invoke(this, EventArgs.Empty);
 }
Example #14
0
 protected virtual void OnUnchecked()
 {
     Unchecked?.Invoke(this, RoutedEventArgsFactory.Create(this));
 }
Example #15
0
 /// <summary>
 ///
 /// </summary>
 protected virtual void OnUnchecked()
 {
     Unchecked?.Invoke(this, new EventArgs());
 }
Example #16
0
 protected virtual void OnUnchecked(EventArgs e)
 {
     Unchecked?.Invoke(this, e);
 }