Hello,
I ran into a scenario where clicking randomly with the mouse to change the date eventually results in a crash. It typically takes 10 or more clicks in relatively fast succession. I was not able to find a specific pattern that causes the crash. However, I can recreate it more reliably when the calendar has MaxDate set.
Here's the crash stack trace:
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key)
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at Telerik.UI.Xaml.Controls.Input.Calendar.XamlDecorationLayer.GetCalendarDecorationVisual(CalendarNode node, CalendarDecorationType decorationType)
at Telerik.UI.Xaml.Controls.Input.Calendar.XamlDecorationLayer.UpdateCalendarCellDecorations(IEnumerable`1 cellsToUpdate)
at Telerik.UI.Xaml.Controls.Input.Calendar.XamlDecorationLayer.UpdateUI(IEnumerable`1 cellsToUpdate)
at Telerik.UI.Xaml.Controls.Input.RadCalendar.UpdatePresenters(IEnumerable`1 cellsToUpdate)
at Telerik.UI.Xaml.Controls.Input.Calendar.CurrencyService.UpdatePresenters(DateTime oldCurrentDate, DateTime newCurrentDate)
at Telerik.UI.Xaml.Controls.Input.Calendar.CurrencyService.<>c__DisplayClass19_0.<
AsyncUpdateCurrencyPresenters
>b__0()
Here's the code I used:
XAML
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
x:Class
=
"CalendarCrash.MainPage"
xmlns:telerikInput
=
"clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"1*"
/>
<
RowDefinition
Height
=
"1*"
/>
</
Grid.RowDefinitions
>
<
telerikInput:RadCalendar
HorizontalOptions
=
"CenterAndExpand"
VerticalOptions
=
"CenterAndExpand"
x:Name
=
"calendar"
/>
<
Label
Grid.Row
=
"1"
Text
=
"Calendar crash"
HorizontalOptions
=
"CenterAndExpand"
VerticalOptions
=
"CenterAndExpand"
/>
</
Grid
>
</
ContentPage
>
Code behind:
using System;
using Xamarin.Forms;
namespace CalendarCrash
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
calendar.MaxDate = DateTime.Now;
}
}
}
Could you recommend any workaround or does this require a bug fix on your end?