Reference Application – Job Management and Timekeeping System for DSL Electric
Lesson #1: Pick a Pattern and Stick to It
- MVVM works very well for Silverlight Line-of-Business applications
- Provides consistency across code
MVVM Pattern Enablers
- Data Binding – Silverlight has awesome data binding engine
- ViewModel – Glue between the server and the screen – Gathers the data to be presented
- Commanding – if control doesn’t support Commanding, you can use the Expression Blend Command Behavior to implement one
- Messaging
If you’re going to get into this pattern, that the time to figure it out. In the long haul, it is worth using.
Lesson #2: Data Binding and Nested Control
- Binding data in nested control scenarios can be challenging
- Data may be out od scope – Items nested in a datagrid
Lesson #3: Notify Users of Successes (and failures)
- Silverlight provides rich animation and media capabilities – Use them.
- Animations can be used to visually indicate success or failure
- Can minimize the number of times the user has to click on a message box
- MediaElement provides a simple way to play sounds
Lesson #4: Get an Agent – A Service Agent
- Make service calls from a service agent
- Allows for better code re-use
- Allows ViewModel classes to stay focused and clean
- Can minimize wrapper code
Lesson #5: Extend Existing Controls
- Extend controls rather than building from scratch
- TextBox –> FilteredTextbox
- ComboBox extended to deal with primary keys better
- AutoCompleteBox –> AutoCompleteComboBox
Downloads
Resources