Example #1
0
        public static StyleSimple Combine(params StyleSimple[] styles)
        {
            var result = new StyleSimple();

            foreach (var item in styles)
            {
                result = Combine(result, item);
            }
            return(result);
        }
Example #2
0
 public static StyleSimple Combine(StyleSimple a, StyleSimple b)
 {
     return(new StyleSimple()
     {
         FontAttributes = (b?.FontAttributes ?? Xamarin.Forms.FontAttributes.None) | (a?.FontAttributes ?? Xamarin.Forms.FontAttributes.None),
         FontSize = b?.FontSize ?? a?.FontSize,
         ForegroundColor = b?.ForegroundColor ?? a?.ForegroundColor,
         //BackgroundColor = b?.BackgroundColor ?? a?.BackgroundColor,
         FontFamily = b?.FontFamily ?? a?.FontFamily,
         //BorderColor = b?.BorderColor ?? a?.BorderColor,
         //BorderSize = b?.BorderSize ?? a?.BorderSize,
         TextDecorations = (b?.TextDecorations ?? Xamarin.Forms.TextDecorations.None) | (a?.TextDecorations ?? Xamarin.Forms.TextDecorations.None),
         LineBreakMode = b?.LineBreakMode ?? a?.LineBreakMode
     });
 }
Example #3
0
        public StyleSimple(StyleSimple styleSimple)
        {
            if (styleSimple == null)
            {
                return;
            }

            FontAttributes  = styleSimple.FontAttributes;
            FontSize        = styleSimple.FontSize;
            ForegroundColor = styleSimple.ForegroundColor;
            BackgroundColor = styleSimple.BackgroundColor;
            FontFamily      = styleSimple.FontFamily;
            BorderColor     = styleSimple.BorderColor;
            BorderSize      = styleSimple.BorderSize;
            TextDecorations = styleSimple.TextDecorations;
            Margin          = styleSimple.Margin;
            LineBreakMode   = styleSimple.LineBreakMode;
        }