protected override void OnModelSet(VisualElement model) { _view = (CalendarView)model; base.OnModelSet(model); var calendarView = new CalendarMonthView(DateTime.Now, true); calendarView.OnDateSelected += (date) => { _view.NotifyDateSelected(date); }; base.SetNativeControl(calendarView); }
public CalendarPage() { InitializeComponent (); _stacker = new StackLayout (); Content = _stacker; _calendarView = new CalendarView() { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.CenterAndExpand }; _stacker.Children.Add (_calendarView); _calendarView.DateSelected += (object sender, DateTime e) => { _stacker.Children.Add(new Label() { Text = "Date Was Selected" + e.ToString("d"), VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.CenterAndExpand, }); }; }