示例#1
0
//</SnippetPropertyChangedCallbackPlusDPDef>
//<SnippetCoerceValueCallback>
        private static object CoerceButtonColor(DependencyObject d, object value)
        {
            ShirtTypes newShirtType = (d as Shirt).ShirtType;

            if (newShirtType == ShirtTypes.Dress || newShirtType == ShirtTypes.Bowling)
            {
                return(ButtonColors.Black);
            }
            return(ButtonColors.None);
        }
示例#2
0
//<SnippetValidateValueCallback>
        private static bool ShirtValidateCallback(object value)
        {
            ShirtTypes sh = (ShirtTypes)value;

            return(sh == ShirtTypes.None || sh == ShirtTypes.Bowling || sh == ShirtTypes.Dress || sh == ShirtTypes.Rugby || sh == ShirtTypes.Tee);
        }