Esempio n. 1
0
        public static ImgBtnGenerator GetInstance()
        {
            if (_buttonGeneraotr == null)
            {
                _buttonGeneraotr = new ImgBtnGenerator();
            }

            return(_buttonGeneraotr);
        }
Esempio n. 2
0
 public static void AddButton(StackLayout container, Func <string, Task> asyncFunction, double width,
                              double height, string text = null, string image = null, double?fontSize = null, Color?backColor = null, AlignImageEnumeration alignImage = AlignImageEnumeration.Left)
 {
     //We don't add duplicates to the stacklayout
     if (container.Children.All(c => c.AutomationId != $"imgBtn{text}"))
     {
         var bg     = ImgBtnGenerator.GetInstance();
         var button = bg.CreateButton(asyncFunction, width, height, text, image, fontSize, backColor, alignImage);
         container.Children.Add(button);
     }
 }
Esempio n. 3
0
 public static void AddButton(StackLayout container, ICommand command, double width,
                              double height, string text = null, string image = null, double?fontSize = null, Color?backColor = null)
 {
     //We don't add duplicates to the stacklayout
     if (container.Children.All(c => c.AutomationId != $"imgBtn{text}"))
     {
         var bg     = ImgBtnGenerator.GetInstance();
         var button = bg.CreateButton(command, width, height, text, image, fontSize, backColor);
         container.Children.Add(button);
     }
 }