Skip to content
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

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

Open
ME-MarvinE opened this issue Dec 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ME-MarvinE
Copy link
Owner

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.

@ME-MarvinE ME-MarvinE added the bug Something isn't working label Dec 14, 2024
@ME-MarvinE ME-MarvinE changed the title Binding to CalendarView Days property inside its DaysTemplate only works after XAML hot reload Binding to the CalendarView's Days property only works after XAML hot reload Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant