Beispiel #1
0
        private static object ThemeCoerceValueCallback(DependencyObject sender, object newValue)
        {
            Theme newTheme = ( Theme )newValue;

            if (newTheme != null)
            {
                if (!newTheme.IsViewSupported(sender.GetType()))
                {
                    throw new ArgumentException("This view is not supported by the specified theme (" + sender.GetType().Name + ").");
                }
            }

            return(newValue);
        }
Beispiel #2
0
 public bool IsViewSupported(Type viewType)
 {
     return(Theme.IsViewSupported(viewType, this.GetType()));
 }