We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to access schedule events in MVVM by using commads

 

You can handle schedule events in MVVM by using commands. This article explains how to use schedule events in MVVM by using commands in the schedule control.

Creating commands in SfScheduleCommands file:

  1. Create commands for needed schedule events in the schedule control for accessing those events in the MVVM. We have created commands for below listed schedule events in the SfScheduleCommands class file.
  1. AppointmentEditorOpening
  2. AppointmentEditorClosing
  3. ContextMenuOpening
  4. ContextMenuClosed
  5. VisibleDatesChanging
  1.  We have used below code snippet to create commands for the above events.

C#

 

  1. Create commands using ICommand interface in the MVVM view model for handling schedule evnets. We have used below code snippet for creating commands to handle the schedule events by using the ICommand interface.

C#

  1. In the above code we have initialized instance for each command by using DelegateCommand class which is in the Syncfusion.windows.shared library.
  2. Now create key for accessing SfScheduleCommands from the assembly namespace as we have created below.

XAML

  1. Now bind the schedule event commands in the MVVM view model to the corresponding commands which we have created in the SfScheduleCommands file. We have used below code snippet for binding the schedule event commands.

 

XAML

 

Now we can trigger the schedule events in MVVM view model by using commands.

 

Sample Link:

 

SfScheduleCommands_MVVM_WPF

 

 

Note:

 

In this KB we have created a commands for the events available in SfSchedule in sample level. In any of our future release it will included inside the Syncfusion library and it can be used directly in sample just by referring the corresponding library.

Article ID: Published Date: Last Revised Date: Platform: Control:
6047 01/21/2016 01/21/2016 WPF SfSchedule
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon