コード例 #1
0
		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");
			}
		}
コード例 #2
0
		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");
			}
		}
コード例 #3
0
		public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
		{
			return size.GetFontSize();
		}
コード例 #4
0
 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();
 }
コード例 #5
0
 public static T FontSize <T>(this T timepicker, NamedSize size) where T : IRxTimePicker
 {
     timepicker.FontSize = Device.GetNamedSize(size, typeof(TimePicker));
     return(timepicker);
 }
コード例 #6
0
 public static double GetFontNamedSize <T>(NamedSize size, T uitype)
 {
     return(Device.GetNamedSize(size, typeof(T)));
 }