Is there any way to use it without using a ViewModel? #151
-
I am not making anything spectacular, |
Beta Was this translation helpful? Give feedback.
Answered by
ME-MarvinE
Jul 25, 2023
Replies: 1 comment
-
Yes, do the same as you would using any other control. You can use x:Name on the CalendarView in the XAML and then change any of its properties from the code behind. But if you're still okay with using bindings (And don't want to redo parts of copy-pasted code from the sample app like DataTriggers), using the Getting Started repo as an example:
After that you should be able to use bindings as normal. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ME-MarvinE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, do the same as you would using any other control. You can use x:Name on the CalendarView in the XAML and then change any of its properties from the code behind.
But if you're still okay with using bindings (And don't want to redo parts of copy-pasted code from the sample app like DataTriggers), using the Getting Started repo as an example:
public Calendar<CalendarDay> MyCalendar { get; set; } = new Calendar<CalendarDay>();
from the ViewModel to the code behind for the page.BindingContext = new MainPageViewModel()
withBindingContext = this
in the code behind of the page.After that you should be able to use bindings as normal.