Skip to content

Repository files navigation

CalendarControl for Avalonia

This is a calendar control (week view) for Avalonia. See and run the sample app to get to know it.

CalendarControl screenshot

How to use

First add the package to your project. Use NuGet to get it: https://www.nuget.org/packages/CalendarControl.Avalonia/

Or use this command in the Package Manager console to install the package manually

Install-Package CalendarControl.Avalonia

Second add a style to your App.axaml (from the sample app)

<Applicationxmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Styles>
<!-- Overall style goes here: <FluentTheme Mode="Light"/> -->
<StyleIncludeSource="avares://SampleApp/Themes/FluentCalendarControl.axaml" />
</Application.Styles>
</Application>

Or use the default one

<Applicationxmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Styles>
<!-- Overall style goes here: <FluentTheme Mode="Light"/> -->
<StyleIncludeSource="avares://CalendarControl/Themes/Default.axaml" />
</Application.Styles>
</Application>

Then add the control to your Window.axaml (minimum)

<Windowxmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:si="clr-namespace:SatialInterfaces.Controls.Calendar;assembly=CalendarControl">
<Grid>
<si:CalendarControl />
</Grid>
</Window>

It's even better to specify the item template with binding to your view model

<Windowxmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:si="clr-namespace:SatialInterfaces.Controls.Calendar;assembly=CalendarControl">
<Grid>
<si:CalendarControl>
<si:CalendarControl.ItemTemplate>
<DataTemplate>
<si:AppointmentControlBegin="{Binding Begin}"End="{Binding End}"Text="{Binding Text}" />
</DataTemplate>
</si:CalendarControl.ItemTemplate>
</si:CalendarControl>
</Grid>
</Window>

About

CalendarControl is a calendar control (week view) for Avalonia. See and run the sample app to get to know it.

Resources

Stars

123 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages