MindFusion.Scheduling for Silverlight Programmer's Guide
ChangeItemCommand Class
Remarks See Also
 





Handles undo / redo of property changes.

Namespace: MindFusion.Scheduling
Assembly: MindFusion.Scheduling.Silverlight

 Syntax

C#  Copy Code

public class ChangeItemCommand : Command

Visual Basic  Copy Code

Public Class ChangeItemCommand
    Inherits Command

 Remarks

The ChangeItemCommand constructor records the state of an item, and its Undo and Redo methods restore the item to either its old or new state.

 Example

The following example shows the pattern that should be used to save the state of an item for later undo.

C#  Copy Code
Item item = calendar.ItemSelection.Items[0];
if (item != null)
{
    ChangeItemCommand change = new ChangeItemCommand(calendar.Schedule, item);
    item.HeaderText = "new header";
    item.StartTime = DateTime.Now;
    item.EndTime = DateTime.Now.AddHours(2);
    calendar.Schedule.ExecuteCommand(change);
}
Visual Basic  Copy Code

Dim item = calendar.ItemSelection.Items(0)
If (item IsNot Nothing) Then

    Dim change As New ChangeItemCommand(calendar.Schedule, item)
    item.HeaderText = "new header"
    item.StartTime = DateTime.Now
    item.EndTime = DateTime.Now.AddHours(2)
    calendar.Schedule.ExecuteCommand(change)

End If

 Inheritance Hierarchy

System.Object
    MindFusion.Scheduling.Command
        MindFusion.Scheduling.ChangeItemCommand

 See Also

ChangeItemCommand Members
MindFusion.Scheduling Namespace