Skip to content

Binding to the CalendarView's Days property only works after XAML hot reload #193

@ME-MarvinE

Description

@ME-MarvinE

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

  1. Using any working CalendarView, set the DaysViewTemplate property to the following ControlTemplate:
                <ControlTemplate>
                    <VerticalStackLayout>
                        <Label Text="{Binding Days, Source={RelativeSource TemplatedParent}}"/>
                        <Label Text="{TemplateBinding Days}"/>
                    </VerticalStackLayout>
                </ControlTemplate>
  1. Run the application and look at the Labels' text; nothing shows up.
  2. Trigger XAML hot reload by using the button in VS
  3. The Labels' 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions