AULA 5 Meu problema é que o DatePicker não aparece valor de maneira alguma. Os valores passam pelas propriedades poré não são exibidas datas e hora
AgendamentoView.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="{Binding Veiculo.Nome}"
x:Class="TestDrive.Views.AgendamentoView">
<StackLayout>
<TableView>
<TableRoot>
<TableSection Title="Seus Dados">
<EntryCell Label="Nome" Text="{Binding Nome}"></EntryCell>
<EntryCell Label="Fone" Text="{Binding Fone}" Keyboard="Telephone"></EntryCell>
<EntryCell Label="E-Mail" Text="{Binding Email}" Keyboard="Email"></EntryCell>
</TableSection>
<TableSection Title="Agendamento">
<ViewCell>
<StackLayout Orientation="Horizontal" Margin="12">
<Label Text="Data" ></Label>
<DatePicker HorizontalOptions="End"
Date="{Binding DataAgendamento}"></DatePicker>
</StackLayout>
</ViewCell>
<ViewCell>
<StackLayout Orientation="Horizontal" Margin="12">
<Label Text="Hora"></Label>
<TimePicker Time="{Binding HoraAgendamento}" ></TimePicker>
</StackLayout>
</ViewCell>
</TableSection>
</TableRoot>
</TableView>
<Button Text="Agendar" Clicked="Button_Clicked">
</Button>
</StackLayout>
</ContentPage>
AgendamentoView.XAML.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TestDrive.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AgendamentoView : ContentPage
{
public veiculo Veiculo { get; set; }
public string Nome { get; set; }
public string Fone { get; set; }
public string Email { get; set; }
DateTime dataAgendamento = DateTime.Today;
public DateTime DataAgendamento {
get
{
return dataAgendamento;
}
set
{
dataAgendamento = value;
}
}
public TimeSpan HoraAgendamento { get; set; }
public AgendamentoView(veiculo veiculo)
{
InitializeComponent();
Veiculo = veiculo;
this.BindingContext = this;
}
private void Button_Clicked(object sender, EventArgs e)
{
DisplayAlert("Agendamento", "Nome" + Nome, "OK");
}
}
}