Just came across this video tutorial by mike taulty about Dataform which has been available in silverlight since V3 : http://www.silverlight.net/learn/videos/silverlight-videos/dataform-control/
There are a couple of things in this video that I really loved about the dataform.
There are a couple of things in this video that I really loved about the dataform.
- Then there is the awesomeness of IEditableObject (I wish I knew about this interface sooner. Would have made dirty data handling so much easier : http://msdn.microsoft.com/en-us/library/system.componentmodel.ieditableobject(v=VS.95).aspx ).
- If you do not set the ItemsSource (and instead set CurrentItem) you can use it as a simply dirty object data handling form :)
- Setting AutoGenerateFields to false, and then setting the DataForm.Fields property to a collection of fields (e.g. DataFormCheckBoxField, DataFormComboBoxField, DataFormDateField etc) with a Binding for each field. Also cool are fields like DataFormHeader (+content property) , DataFormSeperator, DataFormFieldGroup.
- If you don't like these instead of Fields you can use the DisplayTemplate / EditTemplate which are standard DataTemplates
Other points of note :
- The Bindable attribute (http://msdn.microsoft.com/en-us/library/system.componentmodel.bindableattribute(v=VS.95).aspx).
- The Display attribute (http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute(v=VS.95).aspx which just made it into .NET full with v4)
- The CustomValidation attribute ( http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.customvalidationattribute(v=VS.95).aspx also in .Net v4 and above )
No comments:
Post a Comment