Boa tarde, estou com problemas ou passar uma propriedade para um Label, passei meu código a seguir, se puderem me ajudar agradeço.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MarcadorDeTento2"
x:Class="MarcadorDeTento2.MainPage">
<ContentView>
<Grid BackgroundColor="Black">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Picker x:Name="pkcPontos" Grid.Row="0" Grid.ColumnSpan="2"
Title="Escolha a pontuação maxima" TextColor="WhiteSmoke"
BackgroundColor="OrangeRed">
<Picker.Items>
<x:String>12</x:String>
<x:String>15</x:String>
</Picker.Items>
</Picker>
<ListView x:Name="Ponto1" Grid.Column="0" Grid.Row="1">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Label Text="{Binding PontoTime1}"></Label>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<ListView x:Name="Ponto2" Grid.Column="1" Grid.Row="1">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Label Text="{Binding PontoTime2}"></Label>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button x:Name="botaoAdiciona1" Grid.Column="0" Grid.Row="2"
Text="+1" TextColor="WhiteSmoke" FontSize="20"
BackgroundColor="OrangeRed"
Clicked="botaoAdiciona1_Clicked"></Button>
<Button x:Name="botaoAdiciona2" Grid.Column="1" Grid.Row="2"
Text="+1" TextColor="WhiteSmoke" FontSize="20"
BackgroundColor="OrangeRed"
Clicked="botaoAdiciona2_Clicked"></Button>
<Button x:Name="botaoRemove1" Grid.Column="0" Grid.Row="3"
Text="-1" TextColor="WhiteSmoke" FontSize="20"
BackgroundColor="OrangeRed"
Clicked="botaoRemove1_Clicked"></Button>
<Button x:Name="botaoRemove2" Grid.Column="1" Grid.Row="3"
Text="-1" TextColor="WhiteSmoke" FontSize="20"
BackgroundColor="OrangeRed"
Clicked="botaoRemove2_Clicked"></Button>
</Grid>
</ContentView>
</ContentPage>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace MarcadorDeTento2
{
public partial class MainPage : ContentPage
{
GerenciamentoDePontos partida = new GerenciamentoDePontos();
public MainPage()
{
InitializeComponent();
Ponto1.BindingContext = partida.PontoTime1;
}
private void botaoAdiciona1_Clicked(object sender, EventArgs e)
{
partida.AdicionarPonto("botao1");
}
private void botaoAdiciona2_Clicked(object sender, EventArgs e)
{
partida.AdicionarPonto("botao2");
}
private void botaoRemove1_Clicked(object sender, EventArgs e)
{
partida.RetirarPonto("botao1");
}
private void botaoRemove2_Clicked(object sender, EventArgs e)
{
partida.RetirarPonto("botao2");
}
//static int pkcPontos_SelectedIndexChanged(object sender, EventArgs e)
//{
// var picker = (Picker)sender;
// int SelectedIndex = picker.SelectedIndex;
// int pontoMaximo = (int)picker.ItemsSource[SelectedIndex];
// return pontoMaximo;
//}
} }