public double GetNamedSize (NamedSize size, Type targetElement, bool useOldSizes) { switch (size) { case NamedSize.Default: return 10; case NamedSize.Micro: return 4; case NamedSize.Small: return 8; case NamedSize.Medium: return 12; case NamedSize.Large: return 16; default: throw new ArgumentOutOfRangeException ("size"); } }
public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes) { switch (size) { case NamedSize.Default: if (typeof(Label).IsAssignableFrom(targetElementType)) return (double)System.Windows.Application.Current.Resources["PhoneFontSizeNormal"]; return (double)System.Windows.Application.Current.Resources["PhoneFontSizeMedium"]; case NamedSize.Micro: return (double)System.Windows.Application.Current.Resources["PhoneFontSizeSmall"] - 3; case NamedSize.Small: return (double)System.Windows.Application.Current.Resources["PhoneFontSizeSmall"]; case NamedSize.Medium: if (useOldSizes) goto case NamedSize.Default; return (double)System.Windows.Application.Current.Resources["PhoneFontSizeMedium"]; case NamedSize.Large: return (double)System.Windows.Application.Current.Resources["PhoneFontSizeLarge"]; default: throw new ArgumentOutOfRangeException("size"); } }
public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes) { return size.GetFontSize(); }
public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes) { switch (size) { case NamedSize.Medium: case NamedSize.Default: return 14; case NamedSize.Large: return 18; case NamedSize.Small: return 12; case NamedSize.Micro: return 10; } throw new NotImplementedException(); }
public static T FontSize <T>(this T timepicker, NamedSize size) where T : IRxTimePicker { timepicker.FontSize = Device.GetNamedSize(size, typeof(TimePicker)); return(timepicker); }
public static double GetFontNamedSize <T>(NamedSize size, T uitype) { return(Device.GetNamedSize(size, typeof(T))); }