Description
Hi there,
I seem to be having a problem on IOS where if I set the IsVisible property on CalendarView, the ContentPage hosting it will not load. My intention was to control the property from a view model, but I couldn't even get that far. Simply setting the property with the literal "False" repros the issue.
I can't speak for Android as I have not tested on it.
Expected behaviour
I expect the CalendarView to be loaded on its host page and appear/disappear accordingly depending on how the IsVisible property has been set.
Steps to reproduce OR link to code
I have tried this with a new AppShell tabbed project and a new App Project.
Repro steps for the AppShell project are:
- Simply create a new AppShell Project.
- Create a MyCalendar Property in one of the ViewModels of the tab pages (I chose the ItemsViewModel VM)
- Add the CalendarView control on the ItemsPage.xaml (I did so verbatim from the getting-started page).
- Include an IsVisible property to the control in the Xaml.
- Run the project and when the app comes up, try selecting the Items tab and it hangs the app.
I have attached the sample AppShell project.
xCalendarTest.zip
Both tests use the simple example shown on the XCalendar's getting-started page repeated below:
VM
public Calendar<CalendarDay> MyCalendar { get; set; } = new Calendar<CalendarDay>();
XAML
<views:CalendarView
IsVisible="False" <----- Problem
Days="{Binding MyCalendar.Days}"
DaysOfWeek="{Binding MyCalendar.DayNamesOrder}"
NavigatedDate="{Binding MyCalendar.NavigatedDate}"/>
Test details:
Platform: Xamarin Forms (5.0.0.2662)
Calendar (4.6.0)
Tested Device: iPhone 15 Pro Max (IOS 17.4 & 17.2)