Пример #1
0
 private static void OnIsIndeterminateChanged(MetroCheckBox metroCheckBox, AvaloniaPropertyChangedEventArgs e)
 {
     if (metroCheckBox._indeterminateCheck != null)
     {
         metroCheckBox._indeterminateCheck.Opacity = e.NewValue != null && (bool)e.NewValue ? 1 : 0;
     }
 }
Пример #2
0
        private static void OnIsCheckChanged(MetroCheckBox metroCheckBox, AvaloniaPropertyChangedEventArgs e)
        {
            if (metroCheckBox._checkBoxPath != null)
            {
                metroCheckBox._checkBoxPath.Opacity = e.NewValue != null && (bool)e.NewValue ? 1 : 0;

                if (e.NewValue == null && metroCheckBox.IsThreeState)
                {
                    metroCheckBox._checkBoxPath.Opacity = 0;
                }
            }

            if (metroCheckBox.IsThreeState)
            {
                metroCheckBox.IsIndeterminate = e.NewValue == null;
            }
        }