SILVERLIGHT APPLICATION : CSSL4DataFormCancelButton Project Overview


This project demonstrates how to show Cancel Button in DataForm when editting


To test this sample, please try the following steps:
    1. Make sure you have Silverlight 4 Tools for Visual Studio 2010 and
       Silverlight Toolkit installed.
       This demo uses Silverlight 4 Toolkit - April 2010
       It is recommended to install Silverlight_4_Toolkit_April_2010.msi.
       After installation, all related dlls will be added to GAC.
       Otherwise, you need to unzip
       and replace the reference to
       You can find it under
       April 2010 Silverlight Toolkit\April 2010 Silverlight Toolkit\Bin.
       (Right click on your project-->Add Reference -->choose the dll)
    2. Open CSSL4DataFormCancelButton solution and compile.
    3. Run the project.
   4. The Cancel Button will be disabled by default and will be enabled
       when you modify any of the fields or add a new record.       


Silverlight 4 Tools RTM for Visual Studio 2010

Silverlight 4 Toolkit for Visual Studio 2010

Code Logic:

How to achieve the Cancel function?
   1. Create a class which implements IEditableObject Interface and
       BeginEdit,CancelEdit,EndEdit three methods.
    2. Copy the current item when BeginEdit.
    3. Restore the original value When CancelEdit.


IEditableObject Interface

DataAnnotation Class

RangeAttribute Class

INotifyPropertyChanged Interface