public class SampleCalendarPage : ContentPage
{
CalendarView _calendarView;
StackLayout _stacker;
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,
});
};
}
}
Xamarin.Forms.Forms.Init (this, bundle);
SetPage (App.GetMainPage ());
window.RootViewController = App.GetMainPage ().CreateViewController ();
Content = Xamarin.Forms.CalendarSampleApp.App.GetMainPage().ConvertPageToUIElement(this);
Now this is a trivial app, but as you can imagine as the application becomes more complex your UI code will stay in your common library and work across all platforms.
http://www.michaelridland.com/xamarin/xamarin-forms-contest/