//</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); }
//<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); }