|
private Command onMonthInlineAppointmentLoadedCommand;
public Command OnMonthInlineAppointmentLoadedCommand
{
get { return onMonthInlineAppointmentLoadedCommand; }
set
{
onMonthInlineAppointmentLoadedCommand = value;
this.OnPropertyChanged("OnMonthInlineAppointmentLoadedCommand");
}
}
public SchedulerViewModel ()
{
OnMonthInlineAppointmentLoadedCommand = new Command(OnMonthInlineAppointmentLoaded);
}
private void OnMonthInlineAppointmentLoaded(MonthInlineAppointmentLoadedEventArgs obj)
{
var appointment = (obj.appointment as Meeting);
Button button = new Button();
button.Text = appointment.EventName;
button.BackgroundColor = appointment.Color;
button.TextColor = Color.White;
button.Clicked += Button_Clicked;
obj.view = button;
}
private void Button_Clicked(object sender, EventArgs e)
{
App.Current.MainPage.DisplayAlert("", (sender as Button).Text.ToString(), "OK");
} |