Horizontal Calendar Control - is a cross-platform plugin for Xamarin Forms that allows you to display a single row calendar in your app.
Available on NuGet :https://www.nuget.org/packages/HorizontalCalendarControl/1.0.2
Install this Plugin in your Xamarin Form Project.
Install this Plugin in your Xamarin Form Project.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:HorizontalCalendar.Views;assembly=HorizontalCalendar"
x:Class="TestApp.MainPage">
<StackLayout >
<views:HorizontalCalendarControl x:Name="calendarControl"/>
</StackLayout>
</ContentPage>
UI CustomizationUI Customization Property
How to get Selected Date
Design Side:
- HeaderBackgroundColor: Used to set Header background color.
- HeaderTextColor: Used to set Header Text Color.
- LeftRightArrowColor: Used to set left and right arrow color.
- SelectedDateTextColor: Used to set selected date text color.
- SelectedDateBackGroundColor: Used to set selected date text background color.
Write Following Code to get the Selected Date.
<Label Text="{Binding Source={x:Reference calendarControl},Path=SelectedDate}" /> <views:HorizontalCalendarControl x:Name="calendarControl"/>
SelectedDateCommand: use this command to get the selected date.
Design Side:
<views:HorizontalCalendarControl SelectedDateCommand="{Binding SelectedDateCommand}" x:Name="calendarControl" />
Code Behind: (MVVM)
private DateTime _selectedDate;
public DateTime SelectedDate
{
get => _selectedDate;
set => SetProperty(ref _selectedDate, value);
}
public ICommand SelectedDateCommand => new Command<DateTime>((selectedDate) =>
{
SelectedDate = selectedDate;
});
The selected date is not displayed. The result is a useless thing that is not even clear why it is needed. It would be cool if the function of clicking on the date was added...
ReplyDelete