Example #1
0
        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);
        }
Example #2
0
        private static void OnRestStateImageSourceChanged(object sender, DependencyPropertyChangedEventArgs args)
        {
            RadImageButton button = sender as RadImageButton;

            if (!button.isTemplateApplied)
            {
                return;
            }
            button.SetButtonImageSource();
            OnImageSourceChanged(sender, args);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }