Exemplo n.º 1
0
 public int GetFontSize(AdaptiveFontStyle fontStyle, AdaptiveTextSize requestedSize)
 {
     return(FontStyles.GetFontStyle(fontStyle).FontSizes.GetFontSize(requestedSize)
            ?? FontStyles.Default.FontSizes.GetFontSize(requestedSize)
            ?? FontSizes.GetFontSize(requestedSize)
            ?? FontSizesConfig.GetDefaultFontSize(requestedSize));
 }
Exemplo n.º 2
0
        public AdaptiveTextBlock GetadaptiveTextBlock(string InputTxt, AdaptiveTextSize Size, AdaptiveTextColor Color, AdaptiveTextWeight Weight, AdaptiveHorizontalAlignment adaptiveHorizontalAlignment)
        {
            var TextBlock = GetadaptiveTextBlock(InputTxt, Size, Weight, adaptiveHorizontalAlignment);

            TextBlock.Color = Color;
            return(TextBlock);
        }
Exemplo n.º 3
0
        public AdaptiveTextBlock GetadaptiveTextBlock(string InputTxt, AdaptiveTextSize Size, AdaptiveTextWeight Weight, AdaptiveHorizontalAlignment adaptiveHorizontalAlignment)
        {
            var TextBlock = GetadaptiveTextBlock(InputTxt);

            TextBlock.Size   = Size;
            TextBlock.Weight = Weight;
            TextBlock.HorizontalAlignment = adaptiveHorizontalAlignment;
            return(TextBlock);
        }
Exemplo n.º 4
0
 private static void AddTextBlock(AdaptiveColumn column, string text, AdaptiveTextSize size, bool isSubTitle = true)
 {
     column.Items.Add(new AdaptiveTextBlock()
     {
         Text = text,
         Size = size,
         HorizontalAlignment = AdaptiveHorizontalAlignment.Center,
         IsSubtle            = isSubTitle,
         Separator           = false
     });
 }
Exemplo n.º 5
0
        // Create TextBlock
        public static List <AdaptiveElement> CreateTitle(string title, AdaptiveTextSize size = AdaptiveTextSize.Medium)
        {
            var content = new List <AdaptiveElement>();

            if (!string.IsNullOrEmpty(title))
            {
                content.Add(new AdaptiveTextBlock()
                {
                    Size   = size,
                    Id     = "Title",
                    Wrap   = true,
                    Weight = AdaptiveTextWeight.Bolder,
                    Text   = title ?? string.Empty
                });
            }

            return(content);
        }
Exemplo n.º 6
0
        protected static string ConvertSizeToClassName(AdaptiveTextSize textSize)
        {
            switch (textSize)
            {
            case AdaptiveTextSize.ExtraLarge:
                return("display-1");

            case AdaptiveTextSize.Large:
                return("display-2");

            case AdaptiveTextSize.Medium:
                return("display-3");

            case AdaptiveTextSize.Small:
                return("small");

            default:
                return(null);
            }
        }
Exemplo n.º 7
0
        public static int GetDefaultFontSize(AdaptiveTextSize fontSize)
        {
            switch (fontSize)
            {
            case AdaptiveTextSize.Small:
                return(12);

            case AdaptiveTextSize.Medium:
                return(17);

            case AdaptiveTextSize.Large:
                return(21);

            case AdaptiveTextSize.ExtraLarge:
                return(26);

            case AdaptiveTextSize.Default:
            default:
                return(14);
            }
        }
Exemplo n.º 8
0
        public int?GetFontSize(AdaptiveTextSize fontSize)
        {
            switch (fontSize)
            {
            case AdaptiveTextSize.Small:
                return(Small);

            case AdaptiveTextSize.Medium:
                return(Medium);

            case AdaptiveTextSize.Large:
                return(Large);

            case AdaptiveTextSize.ExtraLarge:
                return(ExtraLarge);

            case AdaptiveTextSize.Default:
            default:
                return(Default);
            }
        }
 public static void AddTextBlockWithColumn(AdaptiveColumn column, string text, AdaptiveTextWeight TextWeight, AdaptiveTextSize size, AdaptiveTextColor TextColor, bool isSubTitle = true)
 {
     column.Items.Add(new AdaptiveTextBlock()
     {
         Text   = text,
         Weight = TextWeight,
         Size   = size,
         Color  = TextColor,
         HorizontalAlignment = AdaptiveHorizontalAlignment.Center,
         IsSubtle            = isSubTitle,
         Separation          = AdaptiveSeparationStyle.None
     });
 }
        public static AdaptiveTextBlock AddTextBlock(string value, AdaptiveTextWeight TextWeight, AdaptiveTextSize TextSize, AdaptiveTextColor TextColor)
        {
            AdaptiveTextBlock newAdaptiveTextBlock = new AdaptiveTextBlock()
            {
            };

            newAdaptiveTextBlock.Text = value;

            //newAdaptiveTextBlock.Text = "Sr. No";
            newAdaptiveTextBlock.Weight = TextWeight;
            newAdaptiveTextBlock.Size   = TextSize;
            newAdaptiveTextBlock.Color  = TextColor;
            return(newAdaptiveTextBlock);
        }
Exemplo n.º 11
0
        private void SetColumnContent(AdaptiveColumn col, string storename, string productname, int number, decimal amount, AdaptiveTextSize size)
        {
            var Container = new AdaptiveContainer();
            var Total     = new AdaptiveTextBlock()
            {
                Text = $"{storename}-{productname} X {number}  ${decimal.Round(amount)}", Size = size
            };

            Container.Items.Add(Total);
            col.Items.Add(Container);
        }