-
-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Describe the bug
Binding of the Days
property of the CalendarView
inside the DaysViewTemplate
doesn't work; value changes aren't recognised until hot reload is triggered.
Expected behaviour
Binding of the Days
property of the CalendarView
inside the DaysViewTemplate
doesn't require hot reload to be performed in order to start recognising value changes.
Steps to reproduce OR link to code
- Using any working CalendarView, set the
DaysViewTemplate
property to the followingControlTemplate
:
<ControlTemplate>
<VerticalStackLayout>
<Label Text="{Binding Days, Source={RelativeSource TemplatedParent}}"/>
<Label Text="{TemplateBinding Days}"/>
</VerticalStackLayout>
</ControlTemplate>
- Run the application and look at the
Label
s' text; nothing shows up. - Trigger XAML hot reload by using the button in VS
- The
Label
s' text now shows up.
Xamarin Forms or .NET MAUI (If related to UI)
Both
Device Info (Optional)
Device Model: Samsung SM-G998B on BlueStacks 5 emulator
Android Version: 7.1 (API 25)
Additional Info
The way days are updated in the CalendarView
and DaysView
is by using the PropertyChanged callback of their respective bindable properties. In the DaysView
, the CollectionView
's ItemsSource
property is set. In the CalendarView
, the DaysView
's Days
property is set. This was originally done because binding to those properties didn't work, though I don't remember if I figured out why.