Tip/Trick: Creating and Using Silverlight and WPF User Controls
page 1 of 5
Published: 04 Apr 2008
Unedited - Community Contributed
This article examines the tips and tricks associated with the creation and usage of Silverlight and Windows Presentation Foundation (WPF) user controls. After a brief introduction, he demonstrates how to take an existing User Interface and convert it into a User Control using Expression Blend. Towards the end of the article, he provides a detailed discussion of the various aspects involved with coding.
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 23115/ 47


Republished with Permission - Original Article

One of the fundamental design goals of Silverlight and WPF is to enable developers to be able to easily encapsulate UI functionality into re-usable controls.

You can implement new custom controls by deriving a class from one of the existing Control classes (either a Control base class or from a control like TextBox, Button, etc).  Alternatively you can create re-usable User Controls - which make it easy to use a XAML markup file to compose a control's UI (and which makes them super easy to build).

In Part 6 of my Digg.com tutorial blog series I showed how to create a new user control using VS 2008's "Add New Item" project item dialog and by then defining UI within it.  This approach works great when you know up front that you want to encapsulate UI in a user control.  You can also use the same technique with Expression Blend.

View Entire Article

User Comments

No comments posted yet.

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

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-05-23 7:39:03 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search