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);
		}			
예제 #2
0
		public SampleCalendarPage ()
		{
			Title = "Calendar Sample";

			_stacker = new StackLayout ();
			Content = _stacker;

			_calendarView = new CalendarView() {
				VerticalOptions = LayoutOptions.Start,
				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,
					});
			};

		}