Exemplo n.º 1
0
 internal void RaiseChecked(RoutedEventArgs args)
 {
     if ((ButtonType == ButtonTypes.Toggle) && !IsFullScreen)
     {
         Checked?.Invoke(this, args);
     }
 }
Exemplo n.º 2
0
        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;
                    }
                }
            }
        }
Exemplo n.º 3
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());
                }
            }
        }
Exemplo n.º 4
0
        /*public void OnTextPropertyChanged(
         *  SLDependencyPropertyChangedEventArgs e)
         * {
         *  textBlockName.Text = Text;
         * }
         *
         * public void OnIsCheckedPropertyChanged(
         *  SLDependencyPropertyChangedEventArgs e)
         * {
         *  checkBox.IsChecked = IsChecked;
         * }
         *
         * public void OnLineColorPropertyChanged(
         *  SLDependencyPropertyChangedEventArgs e)
         * {
         *  lineColored.Stroke = new SolidColorBrush(LineColor);
         * }*/

        private void CheckBoxChecked(object sender, RoutedEventArgs e)
        {
            if (Checked != null)
            {
                Checked.Invoke(DataContext, e);
            }
        }
Exemplo n.º 5
0
        protected virtual void OnChecked(bool e)
        {
            CheckedEventArgs args = new CheckedEventArgs {
                IsChecked = e
            };

            Checked?.Invoke(this, args);
        }
Exemplo n.º 6
0
        protected override void OnApplyTemplate()
        {
            PART_BUTTON        = GetTemplateChild <Button>(PART_BUTTON_NAME);
            PART_BUTTON.Click += (s, e) => Clicked?.Invoke(this, e);

            PART_CHECKBOX          = GetTemplateChild <CheckBox>(PART_CHECKBOX_NAME);
            PART_CHECKBOX.Checked += (s, e) => Checked?.Invoke(this, e);
        }
Exemplo n.º 7
0
        private void RadioButton_CheckedChanged(object sender, EventArgs e)
        {
            var radioButton = sender as RadioButton;

            if (radioButton.Checked)
            {
                Checked?.Invoke(sender, e);
            }
        }
Exemplo n.º 8
0
 public void Dispose()
 {
     _stopwatch.Stop();
     Checked?.Invoke(this, new SpeedCheckerArgs()
     {
         ElapsedMilliseconds = _stopwatch.ElapsedMilliseconds,
         Message             = _message,
     });
 }
Exemplo n.º 9
0
 private void CheckBox_Checked(object sender, RoutedEventArgs e)
 {
     if (sender is CheckBox chk && chk.Tag is TorrentFile trnt)
     {
         Set(trnt, chk.IsChecked);
         RecalParent(trnt);
         //tree.Items.Refresh();
         Checked?.Invoke();
     }
 }
Exemplo n.º 10
0
 protected virtual void OnToggle(EventArgs e)
 {
     if (IsChecked)
     {
         Checked?.Invoke(this, e);
     }
     else
     {
         UnChecked?.Invoke(this, e);
     }
 }
Exemplo n.º 11
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());
     }
 }
Exemplo n.º 12
0
        private void CheckedHandler(object sender, RoutedEventArgs e)
        {
            var command          = this.CheckedCommand;
            var commandParameter = this.CheckedCommandParameter ?? this;

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

            Checked?.Invoke(this, e);
        }
Exemplo n.º 13
0
        private protected virtual void OnChecked()
        {
            UpdateVisualState();

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

            args.OriginalSource = this;

            // Raise the event
            Checked?.Invoke(this, args);
        }
Exemplo n.º 14
0
 void Notify(bool val)
 {
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsChecked"));
     if (val)
     {
         Checked?.Invoke();
     }
     else
     {
         Unchecked?.Invoke();
     }
 }
Exemplo n.º 15
0
        protected override void OnTouch(SKTouchEventArgs e)
        {
            if (e.ActionType == SKTouchAction.Pressed && IsEnabled)
            {
                IsChecked = !IsChecked;

                Execute(Command);

                Checked?.Invoke(this, new ToggleButtonEventArgs(IsChecked));

                InvalidateSurface();

                e.Handled = true;
            }
        }
Exemplo n.º 16
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);
        }
Exemplo n.º 18
0
        public bool Check([CanBeNull] object obj)
        {
            bool current;

            lock (_SyncRoot)
            {
                var last = _LastState;
                current = _LastState = _Checker(obj);
                Checked?.Invoke(this, EventArgs.Empty);
                if (current == last)
                {
                    return(current);
                }
                (current ? Raise : Falloff)?.Invoke(this, EventArgs.Empty);
            }
            OnPropertyChanged(nameof(LastState));
            _StateObservers.ForEach(o => o.OnNext(current));
            return(current);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Handler for CheckChanged event.
        /// </summary>
        protected virtual void onCheckChanged(ControlBase control, EventArgs Args)
        {
            if (checkBox.IsChecked)
            {
                if (Checked != null)
                {
                    Checked.Invoke(this, EventArgs.Empty);
                }
            }
            else
            {
                if (UnChecked != null)
                {
                    UnChecked.Invoke(this, EventArgs.Empty);
                }
            }

            if (CheckChanged != null)
            {
                CheckChanged.Invoke(this, EventArgs.Empty);
            }
        }
Exemplo n.º 20
0
        /// <summary>
        /// Handler for CheckChanged event.
        /// </summary>
        protected virtual void OnCheckChanged()
        {
            if (IsChecked)
            {
                if (Checked != null)
                {
                    Checked.Invoke(this, EventArgs.Empty);
                }
            }
            else
            {
                if (UnChecked != null)
                {
                    UnChecked.Invoke(this, EventArgs.Empty);
                }
            }

            if (CheckChanged != null)
            {
                CheckChanged.Invoke(this, EventArgs.Empty);
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// Handler for CheckChanged event.
        /// </summary>
        protected virtual void OnCheckChanged(Base control)
        {
            if (m_CheckBox.IsChecked)
            {
                if (Checked != null)
                {
                    Checked.Invoke(this);
                }
            }
            else
            {
                if (UnChecked != null)
                {
                    UnChecked.Invoke(this);
                }
            }

            if (CheckChanged != null)
            {
                CheckChanged.Invoke(this);
            }
        }
Exemplo n.º 22
0
 public void Check()
 {
     SetStatus(IssueStatus.Checking);
     Checking?.Invoke(this, new EventArgs());
     LastException = null;
     try
     {
         if (IsEnabled)
         {
             CheckTask();
         }
     }
     catch (Exception ex)
     {
         LastException = ex;
         //throw;
     }
     finally
     {
         SetStatus(IssueStatus.Idle);
         Checked?.Invoke(this, new EventArgs());
     }
 }
Exemplo n.º 23
0
        public CheckBoxForm()
        {
            MouseDown = (b) =>
            {
                if (b == 0)
                {
                    Checked = Checked ? false : true;
                    Check?.Invoke(Checked);
                }
            };

            Draw = () =>
            {
                DrawFormSolid(new OpenTK.Vector4(0.2f, 0.2f, 0.2f, 0.9f));
                DrawFormSolid(new OpenTK.Vector4(0.9f, 0.9f, 0.9f, 0.8f), 2, 2, W - 4, H - 4);

                if (Checked)
                {
                    DrawFormSolid(new OpenTK.Vector4(0.2f, 0.2f, 0.2f, 0.9f), 4, 4, W - 8, H - 8);
                }

                DrawText(Text, W + 5, -4);
            };
        }
Exemplo n.º 24
0
 public void Check()
 {
     Debug.WriteLine("---> {0}: {1}", "Check", GetType());
     SetStatus(IssueStatus.Checking);
     Checking?.Invoke(this, new EventArgs());
     LastException = null;
     try
     {
         if (IsEnabled)
         {
             CheckTask();
         }
     }
     catch (Exception ex)
     {
         LastException = ex;
         //throw;
     }
     finally
     {
         SetStatus(IssueStatus.Idle);
         Checked?.Invoke(this, new EventArgs());
     }
 }
Exemplo n.º 25
0
 protected virtual void OnChecked(EventArgs e)
 {
     Checked?.Invoke(this, e);
 }
Exemplo n.º 26
0
 private void UwpControl_Checked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     Checked?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 27
0
 private void ToggleButton_Checked(object sender, RoutedEventArgs e)
 {
     Checked?.Invoke(this, null);
 }
 protected void InvokeChecked(RoutedEventArgs e)
 {
     Checked?.Invoke(this, e);
 }
 void onCheckBoxPressed()
 {
     Checked?.Invoke(this);
 }
Exemplo n.º 30
0
 internal void RaiseChecked(RoutedEventArgs args)
 {
     Checked?.Invoke(this, args);
 }