private static void OnButtonBehaviorChanged(object sender, DependencyPropertyChangedEventArgs args) { RadImageButton button = sender as RadImageButton; if (button.ButtonBehavior != ImageButtonBehavior.ToggleButton && button.IsChecked) { throw new InvalidOperationException("The IsChecked property should be used only if the button's ButtonBehavior is ToggleButton."); } button.UpdateVisualState(true); }
private static void OnRestStateImageSourceChanged(object sender, DependencyPropertyChangedEventArgs args) { RadImageButton button = sender as RadImageButton; if (!button.isTemplateApplied) { return; } button.SetButtonImageSource(); OnImageSourceChanged(sender, args); }
private static void OnButtonShapeChanged(object sender, DependencyPropertyChangedEventArgs args) { RadImageButton button = sender as RadImageButton; if (button.buttonImage == null) { return; } if (button.ButtonShape != ImageButtonShape.Image) { //button.UpdateOpacityMask(); } button.UpdateVisualState(true); }
private static void OnIsCheckedChanged(object sender, DependencyPropertyChangedEventArgs args) { RadImageButton button = sender as RadImageButton; if (button.isCheckedUpdatingInternally) { button.RaiseCheckedChangedEvents(); return; } if (button.ButtonBehavior != ImageButtonBehavior.ToggleButton) { throw new InvalidOperationException("The IsChecked property should be used only if the button's ButtonBehavior is ToggleButton."); } button.isButtonPressed = button.IsChecked; button.RaiseCheckedChangedEvents(); button.UpdateVisualState(true); }
private static void OnButtonTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) { RadImageButton button = sender as RadImageButton; if (!button.isTemplateApplied) { return; } if (button.ButtonType != ImageButtonType.Custom) { button.isImageSourceUpdatingSilently = true; button.RestStateImageSource = null; button.isImageSourceUpdatingSilently = false; } button.SetButtonImageSource(); button.UpdateVisualState(true); }
private static void OnImageSourceChanged(object sender, DependencyPropertyChangedEventArgs args) { RadImageButton button = sender as RadImageButton; if (button.isImageSourceUpdatingSilently) { return; } if (!button.isTemplateApplied) { return; } if (button.ButtonShape != ImageButtonShape.Image) { //button.UpdateOpacityMask(); } button.UpdateVisualState(true); }