This is a migrated thread and some comments may be shown as answers.

SlotSelectionBehavior

1 Answer 42 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 17 Feb 2014, 09:53 PM
Hi,

I created a CustomSlotSelectionBehavior class to limit the slots selection in a single day. In the GetSelectionOverride protected method, I use the "pState.CurrentSelection" to determine the date of the initial slot. If the "CurrentSlot.Start" or the "CurrentSlot.End" are not on the same day than the "pState.CurrentSelection", I want to return a new object with the with "pState.CurrentSelection.Start.Date" or "pState.CurrentSelection.End.Date" and I need to know what is the "DayStartTime/DayEndTime" of the viewdefinition to complete my object. So accomplish that, what shoulf I do?

Thank's
Alain

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 20 Feb 2014, 12:41 PM
Hi Alain,

In order to get the DayStartTime and DayEndTime of the ActiveViewDefinition you will need to firstly bind the ActiveViewDefinition property of the ScheduleView to a property in the ViewModel. Then you will need to add an additional property of CustomSlotSelectionBehavior which will hold the reference of the ViewModel which afterward will be used in order to get the desired properties of the ActiveViewDefinition. The final step will be to define the ViewModel as Resource in XAML so you can pass it to the property as StaticResource. Please check the attached sample project which demonstrates the exact approach.

Hope this helps.

Regards,
Kalin
Telerik
Tags
ScheduleView
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or