Пример #1
0
 public void SelectButton(XButtonFlex buttonToSelect)
 {
     foreach (var form in _stackHorizontal.Children)
     {
         if (form is XButtonFlex b)
         {
             b.Selected = b == buttonToSelect;
         }
     }
 }
Пример #2
0
        public XButtonFlex AddButton(string text, string shortText = "")
        {
            var button = new XButtonFlex
            {
                Text              = text,
                TextLong          = text,
                TextShort         = shortText,
                Margin            = 0,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                WidthRequest      = 40,
                Opacity           = 0.8f
            };

            _stackHorizontal.Children.Add(button);
            return(button);
        }
Пример #3
0
        public static XButtonFlex AddButtonStyle2(int id, string title, string shortTitle = "")
        {
            var button = new XButtonFlex();

            {
                button.Text                       = title;
                button._textLong                  = title;
                button.TextShort                  = shortTitle;
                button.VerticalOptions            = LayoutOptions.FillAndExpand;
                button.AutomationId               = id.ToString();
                button.Radius                     = 4;
                button.BorderColor                = Color.FromHex("#AEBCD0");
                button.TextColor                  = Color.Black;
                button.TextColor_Unselected       = Color.FromHex("#4C4D4C");
                button.BackgroundColor_Unselected = Color.White;
            }

            return(button);
        }