Skip to content

This is a Calendar control that works within the Xamarin.Forms framework. It works on all platforms including iOS, Android and Windows Phone.

Notifications You must be signed in to change notification settings

rid00z/Xamarin.Forms.Calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What the app looks like on each platform(these are real native UI components):

Alt text

The common code that used for the UI:

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,
				});
		};

	}
}

The (Android)platform code:

Xamarin.Forms.Forms.Init (this, bundle);
SetPage (App.GetMainPage ());

The (iOS)platform code:

window.RootViewController = App.GetMainPage ().CreateViewController ();

The (Windows Phone)platform code

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.

Please see this blog post for more info:

http://www.michaelridland.com/xamarin/xamarin-forms-contest/

About

This is a Calendar control that works within the Xamarin.Forms framework. It works on all platforms including iOS, Android and Windows Phone.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages