В этом документе Telerik здесь:
https://docs.telerik.com/devtools/universal-windows-platform/controls/radcalendar/selection
Там написано:
Properties
SelectedDateRange (CalendarDateRange?): Gets or sets the first date range in
the current selection or returns null if the selection is empty. Setting this
property in a calendar that supports multiple selections clears existing
selected ranges and sets the selection to the range specified.
SelectedDateRanges (CalendarDateRangeCollection): Holds a collection of all
selection ranges.
У меня проблемы с привязкой к календарю. Я неправильно понимаю требования, и нет примера.о том, как это сделать.Я использую подход ViewModel.Мой XAML:
<input:RadCalendar
Name="cal"
SelectedDateRange="{x:Bind viewModel.selectedCalendarDateRange, Mode=TwoWay}"
SelectionMode="Multiple"
<input:RadCalendar.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem Command="{x:Bind viewModel.calendarSelectCommand}">OK</MenuFlyoutItem>
</MenuFlyout>
</input:RadCalendar.ContextFlyout>
В моей ViewModel:
public CalendarDateRange? selectedCalendarDateRange {get=>_calendarDateRange;
set => SetProperty(ref _calendarDateRange,value); }
Я выбираю несколько дат и при наведении мыши получаю эту ошибку:
System.ArgumentOutOfRangeException: The added or subtracted value results in
an un-representable DateTime.
Parameter name: value
at System.DateTime.AddTicks(Int64 value)
at Telerik.UI.Xaml.Controls.Input.CalendarDateRange.
IntersectsWithRange(CalendarDateRange otherDateRange)
at Telerik.UI.Xaml.Controls.Input.
CalendarDateRangeCollection.MergeCollidingRanges
(CalendarDateRange newDataRange, Int32 currentIndex)
at Telerik.UI.Xaml.Controls.Input.
CalendarDateRangeCollection.AddDateRange(CalendarD
Как правильно настроить привязку для этого элемента управления?