Вы находитесь на странице: 1из 5

c c

  c
   
The biggest benefit is that it allows a developer to create an application with no User Interface
(UI). A Designer is then able to create the entire UI using Microsoft Expression Blend 4+, without writing
a single line of code.


  

Ô The UI is easier to create when you can do it visually, in a tool, without having to write code
Ô You may have a better UI when it is designed and implemented by people who may not be
programmers
Ô The UI can be created first, or at the same time, as the rest of the code, if needed
Ô The UI can be completely changed without the need to change any code

To achieve this, all you need to do is create a UI (a View) that has no code behind, and
communicates with the application using bindings and commands that are contained in a View Model.

c

The c
 is where the data for the application goes, The Model can contain:
Ô   ʹ A Silverlight application typically needs to communicate with the web server to
get the data, you can put your web service methods here.
Ô G  ʹ The same as web services.
Ô ^

 ʹ Basically any data.

  c
 
The  c
 consists of:

Ô Œ
 ʹ One of something. This could be a String or an Object. Implements
INotifyPropertyChanged, so that any element bound to it, is automatically notified whenever it
changes.
Ô 

 ʹ A collection of something. This is of type ObservableCollection, so that any
element bound to it, is automatically notified whenever it changes.
Ô 
  ʹ An event that can be raised. Also, one parameter of type Object can be passed.
This implements ICommand.

  
This is the part that you can make with no code 
  .
!" 
c
 
Get your data any way you can. Usually calls to web services.
 c
 
Y Consists of:
› Properties ʹ One of something. This could be a String or an Object. Implements
INotifyPropertyChanged, so that any element bound to it, is automatically notified
whenever it changes.
› Collections ʹ A collection of something. This is of type ObservableCollection, so that any
element bound to it, is automatically notified whenever it changes.
› Commands ʹ An event that can be raised. Also, one parameter of type Object can be
passed. This implements ICommand.
- Implemented using Behaviors. Mostly the InvokeCommandAction Behavior
 
Y Properties
› Bind to a text box, radio button, toggle button, MediaElement, trigger an animation or
ViewState change
Y Collections
› Bind to List box, TreeMenu
Y Commands
› Implemented using InvokeCommandAction behavior
- Bind to a ICommand in the ViewModel
- Indicate the ICommand that you want to raise
- Pass a parameter

http://www.codeproject.com/KB/silverlight/RIATasks.aspx

Вам также может понравиться