Silverlight 2 Release Candidate Now Available
page 3 of 6
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 23264/ 56

New Controls

Today's release candidate includes a bunch of feature additions and tweaks across Silverlight 2, as well as in the VS and Blend tools targeting it. In general you'll find a number of nice improvements across the controls, networking, data caching, layout, rendering, media stack, and other components and sub-systems.

Over the next few months we will be releasing a lot of new Silverlight 2 controls (more details on these soon).  Today's release candidate includes three new core controls - ComboBox, ProgressBar, and PasswordBox - that we are adding directly to the core Silverlight runtime download (which is still only 4.6MB in size, and only takes a few seconds to install):

Figure 1

At runtime these controls by default look like:

Figure 2

The ComboBox in Silverlight 2 supports standard DropDownList semantics.  In addition to statically defining items like above, you can also use databinding with it.  For example, we could define a "Person" class like below:

Figure 3

And the add a ComboBox to a page like so:

Figure 4

And then write the below code to databind a collection of Person objects to the ComboBox (by setting its ItemSource property):

Figure 5

At runtime our simple app will then display the data-bound Person names (note that we set the DisplayMemberPath property on the ComboBox above to display the "Name" value from our Person objects):

Figure 6

We could then implement a SelectionChanged event handler like below to run code when a person is selected from the ComboBox:

Figure 7

Notice above how we can retrieve a reference to the selected "Person" object from the databound ComboBox using the ComboBox's "SelectedItem" property. 

We can then call the MessageBox.Show() helper method (new in the RC) to display a modal dialog box that displays some details about our selected person:

Figure 8


View Entire Article

User Comments

Title: Mr.   
Name: Ram R
Date: 2010-07-31 5:17:10 AM
Comment:
very nice explanation
thanks for this kind of help for developer who aspiring to learn about new technology.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-26 2:28:57 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search