Example #1
0
        static object OnRadiusCoerceCallback(DependencyObject obj, object value)
        {
            ACMButton @this = obj as ACMButton;

            @this._radiusTemp = (double)value;          // Saving value to temporary variable for reset when FormType property was changed from square to circle.
            if (@this.FormType != ACMButtonForm.Circle)
            {
                return(0.0);
            }
            return(value);
        }
Example #2
0
        /// <summary>
        /// If Radius property is validation, then change width and height by force.
        /// </summary>
        static void OnRadiusPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ACMButton @this = obj as ACMButton;

            if (null != args.NewValue)
            {
                double newValue = (double)args.NewValue;
                @this.Width  = newValue;
                @this.Height = newValue;
            }
        }
Example #3
0
        /// <summary>
        /// Refresh Radius value once FormType was changed.
        /// </summary>
        static void OnFormtypeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ACMButton @this = obj as ACMButton;

            ACMButtonForm forType = (ACMButtonForm)args.NewValue;

            if (forType == ACMButtonForm.Circle)
            {
                @this.Radius = @this._radiusTemp;
            }
        }
Example #4
0
        static object OnWithOrHeightCoerceCallback(DependencyObject obj, object value)
        {
            ACMButton @this = obj as ACMButton;

            switch (@this.FormType)
            {
            case ACMButtonForm.Square: return(value);

            case ACMButtonForm.Circle: return(@this.Radius);

            default: return(value);
            }
        }
Example #5
0
        static void OnProcessingPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ACMButton @this = obj as ACMButton;

            bool newValue = (bool)args.NewValue;

            if (newValue != true)
            {
                return;
            }

            @this.IsProcessStart = true;
        }