protected override void OnAppearing() { base.OnAppearing(); var layout = new RelativeLayout(); Content = layout; var ab = new ActionButton { ButtonColor = Color.FromHex("#E91E63"), ButtonIcon = FontAwesomeLabel.FAThumbsUp, }; layout.Children.Add(ab, () => new Rectangle((layout.Width / 4) - (56 / 2), (layout.Height / 2) - (56 / 2), 56, 56)); var abtgl = new ToggleActionButton { ButtonColor = Color.FromHex("#FF5722"), ButtonIcon = FontAwesomeLabel.FAPlus, }; abtgl.SetBinding(IsToggledProperty, "IsToggled"); layout.Children.Add(abtgl, () => new Rectangle((layout.Width / 2) - (56 / 2), (layout.Height / 2) - (56 / 2), 56, 56)); _command = new Command((obj) => {}, (obj) => abtgl.IsToggled); var playButton = new ActionButton { ButtonColor = Color.FromHex("#2196F3"), ButtonIcon = FontAwesomeLabel.FAPlay, Command = _command, }; var abex = new ExpandableActionButton { ButtonColor = Color.FromHex("#FF9800"), Buttons = { playButton, new ActionButton { ButtonColor = Color.FromHex("#009688"),ButtonIcon = FontAwesomeLabel.FATag }, new ActionButton { ButtonColor = Color.FromHex("#CDDC39"),ButtonIcon = FontAwesomeLabel.FARoad }, } }; layout.Children.Add(abex, () => new Rectangle(((layout.Width / 4) * 3) - (56 / 2), (layout.Height / 2) - (200), 56, 250)); }
protected override void OnAppearing () { base.OnAppearing (); var layout = new RelativeLayout (); Content = layout; var ab = new ActionButton { ButtonColor = Color.FromHex("#E91E63"), ButtonIcon = FontAwesomeLabel.FAThumbsUp, }; layout.Children.Add(ab, () => new Rectangle((layout.Width/4)-(56/2), (layout.Height/2)-(56/2), 56, 56)); var abtgl = new ToggleActionButton { ButtonColor = Color.FromHex("#FF5722"), ButtonIcon = FontAwesomeLabel.FAPlus, }; abtgl.SetBinding (IsToggledProperty, "IsToggled"); layout.Children.Add(abtgl, () => new Rectangle((layout.Width/2)-(56/2), (layout.Height/2)-(56/2), 56, 56)); _command = new Command ((obj) => {}, (obj) => abtgl.IsToggled); var playButton = new ActionButton{ ButtonColor = Color.FromHex ("#2196F3"), ButtonIcon = FontAwesomeLabel.FAPlay, Command = _command, }; var abex = new ExpandableActionButton { ButtonColor = Color.FromHex("#FF9800"), Buttons = { playButton, new ActionButton{ ButtonColor = Color.FromHex("#009688"), ButtonIcon = FontAwesomeLabel.FATag}, new ActionButton{ ButtonColor = Color.FromHex("#CDDC39"), ButtonIcon = FontAwesomeLabel.FARoad}, } }; layout.Children.Add(abex, () => new Rectangle(((layout.Width/4)*3)-(56/2), (layout.Height/2)-(200), 56, 250)); }