unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.9k stars 721 forks source link

[Gallery][All Platform]DataGrid - When opening the calendar for the 'Date Planted' section, it displays the default current year as 1924. #16064

Open sakshi173 opened 7 months ago

sakshi173 commented 7 months ago

Current behavior

https://github.com/unoplatform/uno/assets/74563602/9ecc575e-0374-49aa-a524-8ce82dd23c3a

Datgrid calendar issue

Expected behavior

Calendar should display current year '2024'

How to reproduce it (as minimally and precisely as possible)

  1. Launch the Uno.Gallery app for 4X or 5X version for Android.
  2. Click on “DataGrid” from the "Community Toolkit" list.
  3. Go to 'Date Planted' section
  4. Click on any existing date.
  5. Calendar should open.
  6. In the open calendar click on the top display of the monthyear section(March2024).
  7. Notice that it displays the default current year as 1924.

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

WebAssembly, Android, iOS, Skia (GTK on Linux/macOS/Windows)

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Youssef1313 commented 6 months ago

Seeing some exceptions in browser logs:

      Failed to apply binding to property [DependencyPropertyDetails(Date)] on [Microsoft.UI.Xaml.Controls.CalendarDatePicker] (ConvertFromException, DateTimeOffsetConverter, System.DateTime)
System.NotSupportedException: ConvertFromException, DateTimeOffsetConverter, System.DateTime
   at System.ComponentModel.DateTimeOffsetConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at Uno.UI.DataBinding.BindingPropertyHelper.ConvertUsingTypeDescriptor(Type type, Object value)
   at Uno.UI.DataBinding.BindingPropertyHelper.Convert(Type propertyType, Object value)
   at Microsoft.UI.Xaml.Data.BindingExpression.SetTargetValueSafe(Object v, Boolean useTargetNullValue)

Not sure if they are related.

Youssef1313 commented 6 months ago

There is also (this one is likely the root cause):

      Failed to raise 'PointerReleasedEvent': System.InvalidOperationException: Layout cycle detected.
         at Microsoft.UI.Xaml.UIElement.UpdateLayout()
         at Microsoft.UI.Xaml.Controls.CalendarView.OnDisplayModeChanged(CalendarViewDisplayMode oldDisplayMode, CalendarViewDisplayMode newDisplayMode)
         at Microsoft.UI.Xaml.DependencyObjectStore.InnerSetValue(DependencyProperty property, Object value, DependencyPropertyValuePrecedences precedence, DependencyPropertyDetails propertyDetails, Boolean isPersistentResourceBinding)
         at Microsoft.UI.Xaml.Controls.CalendarView.set_DisplayMode(CalendarViewDisplayMode value)
         at Microsoft.UI.Xaml.Controls.CalendarView.OnHeaderButtonClicked()
         at Microsoft.UI.Xaml.Controls.CalendarView.<AttachButtonClickedEvents>b__664_0(Object pSender, RoutedEventArgs pArgs)
         at Microsoft.UI.Xaml.Controls.Control.<>c.<.cctor>b__367_10(Object sender, PointerRoutedEventArgs args)
         at Microsoft.UI.Xaml.UIElement.RaisePointerEvent(RoutedEvent evt, PointerRoutedEventArgs args, BubblingContext ctx)

😕