public async Task AdicionarControles() { StackLayout layoutPrincipal = new StackLayout(); layoutPrincipal.Spacing = 0; layoutPrincipal.BackgroundColor = Color.FromHex("#FFFFFF"); layoutPrincipal.Children.Add(new ToobarFormulario()); ScrollView view = new ScrollView(); view.BackgroundColor = Color.FromHex("#FFFFFF"); view.SetBinding(ScrollView.IsVisibleProperty, new Binding("IsRunning", BindingMode.TwoWay, new NegateBooleanConverter())); StackLayout layout = new StackLayout(); arvoreFormulario = new ArvoreFormulario(this.page); layout.Children.Add(arvoreFormulario); view.Content = layout; layoutPrincipal.Children.Add(view); layoutPrincipal.Children.Add(new ActivityIndicatorRunning(Color.Gray)); StackLayout layoutFooter = new StackLayout(); layoutFooter.Orientation = StackOrientation.Vertical; layoutFooter.BackgroundColor = Color.FromHex("#3F51B5"); layoutFooter.VerticalOptions = LayoutOptions.EndAndExpand; layoutFooter.HorizontalOptions = LayoutOptions.FillAndExpand; StackLayout layoutFooterBotoes = new StackLayout(); layoutFooterBotoes.Orientation = StackOrientation.Horizontal; layoutFooterBotoes.BackgroundColor = Color.FromHex("#3F51B5"); Button btnDownload = new Button() { Image = "download.png", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.FromHex("#3F51B5"), Text = " Download", TextColor = Color.FromHex("#FFFFFF") }; btnDownload.SetBinding(Button.CommandProperty, new Binding("CmdBaixar", BindingMode.OneWay)); layoutFooterBotoes.Children.Add(btnDownload); VerificarExibirDetalhes(); Button btnDetalhes = new Button() { Image = "ic_chart_pie_white_36dp.png", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.FromHex("#3F51B5"), Text = " Detalhes", TextColor = Color.FromHex("#FFFFFF") }; btnDetalhes.SetBinding(Button.CommandProperty, new Binding("CmdDetalhes", BindingMode.OneWay)); btnDetalhes.SetBinding(Button.IsEnabledProperty, new Binding("ExibirDetalhes", BindingMode.OneWay)); layoutFooterBotoes.Children.Add(btnDetalhes); StackLayout layoutIcon = new StackLayout(); layoutIcon.Orientation = StackOrientation.Horizontal; layoutIcon.BackgroundColor = Color.FromHex("#3F51B5"); layoutIcon.VerticalOptions = LayoutOptions.EndAndExpand; layoutIcon.HorizontalOptions = LayoutOptions.CenterAndExpand; Label labelIcon = new Label(); labelIcon.FontSize = 10; labelIcon.FontAttributes = FontAttributes.Bold; labelIcon.Text = "EZQUEST - Powered by ICON"; labelIcon.TextColor = Color.Yellow; layoutIcon.Children.Add(labelIcon); layoutFooter.Children.Add(layoutFooterBotoes); layoutFooter.Children.Add(layoutIcon); layoutPrincipal.Children.Add(layoutFooter); this.page.Content = layoutPrincipal; }
public void AdicionarControles() { StackLayout layoutPrincipal = new StackLayout(); layoutPrincipal.Spacing = 0; layoutPrincipal.BackgroundColor = Color.FromHex("#FFFFFF"); layoutPrincipal.Children.Add(new ToobarFormulario()); layoutPrincipal.Children.Add(new Contadores(formulario)); ScrollView view = new ScrollView(); view.BackgroundColor = Color.FromHex("#FFFFFF"); view.SetBinding(ScrollView.IsVisibleProperty, new Binding("IsRunning", BindingMode.TwoWay, new NegateBooleanConverter())); StackLayout layout = new StackLayout(); arvoreFormulario = new ArvoreFormulario(this.page, pesquisa06); arvoreFormulario.Formulario = formulario; layout.Children.Add(arvoreFormulario); view.Content = layout; layoutPrincipal.Children.Add(view); layoutPrincipal.Children.Add(new ActivityIndicatorRunning()); StackLayout layoutFooter = new StackLayout(); layoutFooter.Spacing = 0; layoutFooter.Orientation = StackOrientation.Vertical; layoutFooter.BackgroundColor = Color.FromHex("#3F51B5"); layoutFooter.HorizontalOptions = LayoutOptions.FillAndExpand; layoutFooter.VerticalOptions = LayoutOptions.EndAndExpand; StackLayout layoutFooterBotao = new StackLayout(); layoutFooterBotao.Orientation = StackOrientation.Horizontal; layoutFooterBotao.BackgroundColor = Color.FromHex("#3F51B5"); layoutFooterBotao.HorizontalOptions = LayoutOptions.FillAndExpand; layoutFooterBotao.Spacing = 0; Button btnConfirmar = new Button() { Image = "confirmar_formulario.png", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.FromHex("#3F51B5"), Text = " Finalizar", TextColor = Color.FromHex("#FFFFFF") }; btnConfirmar.SetBinding(Button.CommandProperty, new Binding("CmdFinalizarFormulario", BindingMode.OneWay)); layoutFooterBotao.Children.Add(btnConfirmar); Button btnEnviar = new Button() { Image = "enviar.png", Text = "Enviar", TextColor = Color.FromHex("#FFFFFF"), BackgroundColor = Color.FromHex("#3F51B5"), HorizontalOptions = LayoutOptions.CenterAndExpand }; btnEnviar.SetBinding(Button.CommandProperty, new Binding("CmdEnviar", BindingMode.OneWay)); layoutFooterBotao.Children.Add(btnEnviar); StackLayout layoutLabel = new StackLayout(); layoutLabel.Orientation = StackOrientation.Horizontal; layoutLabel.BackgroundColor = Color.FromHex("#3F51B5"); layoutLabel.HorizontalOptions = LayoutOptions.FillAndExpand; layoutLabel.VerticalOptions = LayoutOptions.End; Label lblIcon = new Label() { Text = "EZQUEST 1.7 - Powered by ICON", TextColor = Color.Yellow, FontSize = 10, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.End, FontAttributes = FontAttributes.Bold, }; layoutLabel.Children.Add(lblIcon); layoutFooter.Children.Add(layoutFooterBotao); layoutFooter.Children.Add(layoutLabel); layoutPrincipal.Children.Add(layoutFooter); this.page.Content = layoutPrincipal; }