-1
I made a button, listview. The listview is working because I started it, but how do I do with button? Below my code:
protected override async void OnAppearing()
{
base.OnAppearing();
//Task.Run(async () => await CarregaDados(IdOrcamento)).GetAwaiter().GetResult();
await CarregaDados(IdOrcamento);
Entry ent = new Entry
{
Placeholder = "Motivo"
};
Button btnOk = new Button
{
Text = "Aprovar",
BackgroundColor = Color.Gold,
Font = Font.Default,
FontSize = 10,
TextColor = Color.Green,
HeightRequest = 35,
WidthRequest = 80
};
Button btnCancel = new Button
{
Text = "Negar",
BackgroundColor = Color.Gold,
Font = Font.Default,
FontSize = 10,
TextColor = Color.Green,
HeightRequest = 35,
WidthRequest = 80
};
Button btnVoltar = new Button
{
Text = "Voltar",
BackgroundColor = Color.Gold,
Font = Font.Default,
FontSize = 10,
TextColor = Color.Red,
HeightRequest = 35,
WidthRequest = 80
};
btnVoltar.Clicked += Voltar;
ListView lv = new ListView()
{
HasUnevenRows = true,
SeparatorVisibility = SeparatorVisibility.Default,
BackgroundColor = Color.White,
SeparatorColor = Color.Gold,
SelectedItem = "lv_ItemSelected",
WidthRequest = 240,
HeightRequest = 180
};
lv.ItemsSource = _data;
lv.ItemTemplate = new DataTemplate(typeof(ListItemCell));
lv.ItemTemplate.SetBinding(TextCell.TextProperty, "Produto");
lv.ItemTemplate.SetBinding(TextCell.DetailProperty, "DadosItens");
this.Content = lv;
}
private static void Voltar(object sender, EventArgs e)
{
}