XCalendar icon indicating copy to clipboard operation
XCalendar copied to clipboard

upgrading from version 3 to 4 breaks the application

Open ddavid-son opened this issue 2 years ago • 4 comments

** I have tried to upgrade from version 3 to 4 to use the EVENT CALENDAR and now I get error on field that don have a arefrance anymore

for example

<views:CalendarView x:Name="xCalendar" Grid.Row="6" SelectionType="Single" DayRangeMinimumDate="{Binding Today}" IsVisible="false" SelectionAction="Modify" />

while I have this import as required:

xmlns:views="clr-namespace:XCalendar.Maui.Views;assembly=XCalendar.Maui"

will yield error on:

ItemPage.xaml.cs(55, 27): [CS1061] 'CalendarView' does not contain a definition for 'SelectedDates' and no accessible extension method 'SelectedDates' accepting a first argument of type 'CalendarView' could be found (are you missing a using directive or an assembly reference?)

and so does DayRangeMinimumDate and SelectionAction with the same error **

Everything needs to be working, the upgrade alone breaks the application, when I change the nugget back to version 3 everything works ok

the problem is on .NET MAUI app

running on m1 MacBook Pro and 2 different pc's trying to build with rider on Mac and visual studio on pc

thanks in advance

ddavid-son avatar Sep 07 '22 14:09 ddavid-son

Hi David,

Thanks for providing details for the issue!

Yes, with each new major version (x.o.o) there are a large amount of breaking changes from the previous version. With each minor version (o.x.o) there may or may not be breaking changes, and with each bug fix version (o.o.x) there are no breaking changes.

To see what changes were made you can view the releases page. The changes from 3.x.x to 4.x.x can be found here.

You can also view the wiki for guides and documentation for the most recent version of the plugin.

In short, all the properties that define the Calendar's behaviour have moved to the class 'Calendar' in namespace 'XCalendar.Core'. Make an instance of this class in your ViewModel and bind its values to the CalendarView.

The Getting Started page is super useful for identifying how to migrate to the current version. You only need to bind the properties specified in the examples of that page. Everything else is optional.

ME-MarvinE avatar Sep 07 '22 16:09 ME-MarvinE

thank you,

can you point me to a good explanation of how to use the event calendar, the sample app is not working(in my machine at least) and I can't find details about it in the wiki

thanks in advance

ddavid-son avatar Sep 09 '22 09:09 ddavid-son

What happens when you try to run the sample app on your machine? I know some people have had problems because they had installed earlier versions of MAUI.

While you can't run the sample app, you can still view the code for the EventCalendar example here.

The Calendar class uses generics to determine what the type of each day should be.

By default this is a CalendarDay but it could be any class that implements the ICalendarDay interface. In the example, there is a class called EventDay which has a list of Event which is what is binded to in the XAML to make the dots for each day.

The example uses the CollectionChanged event of the Calendar's SelectedDates collection to update the list of events for each day, but you can also use Calendar's DateSelectionChanged event to get the previous selected dates.

It also uses the DaysUpdated event to respond to any changes caused by the Calendar. For example if the FirstDayOfWeek changes or the Calendar is navigated. Again, it updates the days' list of events based on what dates are selected.

ME-MarvinE avatar Sep 09 '22 12:09 ME-MarvinE

Hi @ddavid-son, are you still experiencing this issue?

ME-MarvinE avatar Oct 13 '22 23:10 ME-MarvinE

Closed due to inactivity.

ME-MarvinE avatar Mar 11 '24 00:03 ME-MarvinE