-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing DateTime of a day in viewmodel to make more control for background changing #111
Comments
new CalendarView{ VerticalOptions = LayoutOptions.Start, DayTemplate = new DataTemplate{}
} that's all i can get but i don't know how to implement DataTemplate, help me please, with any solution |
The So just like how you would normally bind to your ViewModel's properties, you can bind to all the properties of the If you want to change this value from your ViewModel, just change it in the actual collection you binded the CalendarView's public void Set8thDayToToday()
{
//Assuming you have binded the 'Days' property to 'MyCalendar.Days' in your CalendarView:
MyCalendar.Days[7].DateTime = DateTime.Today;
} However, since the days' properties get changed by the Calendar such as For example: ViewModel: public class MyViewModel
{
public Calendar<CalendarDay> MyCalendar { get; set; } = new Calendar();
public MyViewModel()
{
MyCalendar.DaysUpdated += MyCalendar_DaysUpdated();
}
public void MyCalendar_DaysUpdated(object sender, EventArgs e)
{
Set8thDayToToday();
}
public void Set8thDayToToday()
{
MyCalendar.Days[7].DateTime = DateTime.Today;
}
} View: <xc:CalendarView Days="{Binding MyCalendar.Days"} DaysOfWeek="{Binding MyCalendar.DayNamesOrder}" NavigatedDate="{Binding MyCalendar.NavigatedDate}">
<xc:CalendarView.DayTemplate>
<DataTemplate>
<!--This will bind to the 'DateTime' property of the CalendarDay-->
<Label Text="{Binding DateTime}"/>
</DataTemplate>
</xc:CalendarView.DayTemplate>
</xc:CalendarView> I don't know how to create views in C#. You can find many resources on the internet that will explain bindings in C# better than me. |
i need to make work day another color and selected another too :
|
You can replicate the default functionality of a day by using a To change what colours the Currently there is no easy way to override the changes that the
|
DayViews can now be customised using styles for each Default functionality can now be replicated by using a markup reference to set the There is now an easy way to override the changes that the DayView makes based on the DayState.DayViews: set the Your "IsWorkDay" property would go in the class that inherits from Did this solve your issue? |
Hello, i have a problem with some logic, how can i pass here DateTime of a day instead static one 9-2-2023 ?
or how i can make it in c#?
i can't make children of it and this solution is faster i think
The text was updated successfully, but these errors were encountered: