October 29th, 2009

Making an object re-usable as a User Control in Blend

Silverlight Blend Tutorials, Working with Silverlight, by Gavin Wignall.

This post is part of a string of posts found here: Learn Blend in a Month.

If you are using multiple instances of elements then it may make more sense to think about making these elements User Controls. User Controls allow you to place objects into a container that can be re-used again and again, even multiple times at once. Every User Control has its own XAML file and its own code file.

To make a selection of elements on stage into a User Control it is really simple. First select all the objects you want to include in your new User Control, then right click anywhere on the selected objects. From the drop down options select ‘Make into UserControl…‘. This creates a new XAML file containing the objects you selected with it’s own code behind file too.

Each time you want to add a new instance of your User Control you will need to add the following XAML in…

<local:UserControlName Margin=”0,0,0,0″/>

Back Top

Responses to “Making an object re-usable as a User Control in Blend”

  1. No comments yet.
  1. uberVU - social comments (,October 31, 2009)

    Social comments and analytics for this post…

    This post was mentioned on Twitter by Silverlight News: Making an object re-usable as a User Control in Blend – http://snurl.com/sx3mi...

  2. Making an object re-usable as a User Control in Blend … iSilverlight (,October 31, 2009)

    [...] original post here:  Making an object re-usable as a User Control in Blend … By admin | category: Silverlight, silverlight control | tags: application, are-looking, [...]

Leave a Reply

Back Top