Beispiel #1
0
        public static ImgBtnGenerator GetInstance()
        {
            if (_buttonGeneraotr == null)
            {
                _buttonGeneraotr = new ImgBtnGenerator();
            }

            return(_buttonGeneraotr);
        }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }