Using the Silverlight Kit for MySpace in Expression Blend

  1. Download the Release Binaries to your system.
  2. Start Expression Blend 2 SP1.
  3. In Expression Blend, create a new Silverlight 2 Application project. NewProject.png
  4. Once the project has been created, in the Project tab, right-click on the References folder and select Add Reference... AddReference.png
  5. Navigate to the folder where you downloaded the Release Binaries to in step 1, select the bin\Release\MySpaceSilverlightKit.dll assembly, and press the Open button.
  6. In the Project Tab, Data section, press the + CLR Object button.
  7. Expand out the MySpaceSilverlightkit/MyOpenSpace folder and select one of the Request objects (MyOpenSpace.MySpacePeopleRequest, MyOpenSpace.MySpacePersonRequest, or MyOpenSpace.MySpaceVideosRequest). Give the data source a name that is relevant to its usage, like MyFriends_. AddCLRObjectDataSource.png
  8. Add controls to the design surface that will bind to the CLR object. Controls like ListBox and DataGrid can bind to the MyOpenSpace.MySpacePeopleRequest.People property while Controls like Image can bind to the MySpacePersonRequest.Person.ThumbnailImage property. AddedListBox.png
  9. To bind the ListBox items to the MyOpenSpace.MySpacePeopleRequest, select the ListBox and click on the Advanced Propety Options button to the right of the Common Properties/ItemsSource property in the Properties tab. Then select the Data Binding... option in the context menu.AdvancedPropertyOptions.png.
  10. Select the CLR Data source you added in step 7 on the left and the MyOpenSpace.MySpacePeopleRequest/People property on the right. Press the Finish button to create the data binding. CreateDataBinding.png
  11. Add the properties for the data source that will not change, like the MyOpenSpace.MySpacePeopleRequest.IdSpec property. Refer to documentation pages on this site for more details on the propreties for each of the CLR objects. You will have to switch to XAML view to add the properties: AddingIdSpec.png
  12. You will now see the control with sample data (not from MySpace). The classes in this kit emit their content as string so you can see what properties you can bind to. SampleData.png
  13. You can then specify a DisplayMemberPath to be the name of one of the properties or create a Data Template to represent each item in the collection.

Last edited Mar 31, 2009 at 12:43 AM by mscherotter, version 17


No comments yet.