public NamedThickness(ExetendedNamedSize left, ExetendedNamedSize top, ExetendedNamedSize right, ExetendedNamedSize bottom) { Top = SXF.GetUnitSize(top); Left = SXF.GetUnitSize(left); Right = SXF.GetUnitSize(right); Bottom = SXF.GetUnitSize(bottom); }
private static double GetSize(ExetendedNamedSize size, bool font) { var baseunit = font ? DefaultFontSize : DefaultUnitSize; double baseSpacing = Device.GetNamedSize(NamedSize.Large, typeof(Label)) - Device.GetNamedSize(NamedSize.Medium, typeof(Label)); var unitSpacing = font ? baseSpacing : DefaultUnitSize / 2; switch (size) { case ExetendedNamedSize.Default: return(baseunit); case ExetendedNamedSize.XSmall: return(baseunit - unitSpacing * 2); case ExetendedNamedSize.xSmall: return(baseunit - unitSpacing * 1.5); case ExetendedNamedSize.Small: return(baseunit - unitSpacing); case ExetendedNamedSize.Normal: return(baseunit); case ExetendedNamedSize.Large: return(baseunit + unitSpacing); case ExetendedNamedSize.xLarge: return(baseunit + unitSpacing * 1.5); case ExetendedNamedSize.XLarge: return(baseunit + unitSpacing * 2); case ExetendedNamedSize.xxLarge: return(baseunit + unitSpacing * 2.5); case ExetendedNamedSize.XXLarge: return(baseunit + unitSpacing * 3); case ExetendedNamedSize.Zero: return(0); default: return(baseunit); } }
public static double GetUnitSize(ExetendedNamedSize size) => GetSize(size, false);
public static double GetFontSize(ExetendedNamedSize size) => GetSize(size, true);
public NamedThickness(ExetendedNamedSize horizontalSize, ExetendedNamedSize verticalSize) : this(horizontalSize, verticalSize, horizontalSize, verticalSize) { }
public NamedThickness(ExetendedNamedSize uniformSize) : this(uniformSize, uniformSize, uniformSize, uniformSize) { }