Examining Various Silverlight Containers
page 6 of 8
by Brian Mains
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 35965/ 83


The Silverlight framework (as well as WPF) provides a resource location to store objects within it.  Resources are available at the application level, user control level, and pretty much every-other-control-level that it's very handy to create a reusable template through this scenario, such as:

Listing 8: Reusing control templates

    <ControlTemplate x:Key="MyCustomTemplate">
         <Border BorderBrush="Beige" BorderThickness="2">
            <TextBlock Margin="20" Text="My templated content via resources" />
<HeaderedContentControl HeaderTemplate="{StaticResource MyCustomTemplate}" />

Any control can override the default template by providing a custom template using the StaticResource keyword.  This keyword designates a resource stored in the UserControl's resources collection, and will dynamically supply the template at runtime.

View Entire Article

User Comments

Title: Microsoft.Windows.Controls   
Name: Evgen
Date: 2010-08-26 4:42:38 AM
May be
instead of
Title: Silverlight   
Name: Prabhakar
Date: 2009-07-15 7:51:36 AM
This is article very useful. I have query "Can we add a xmal file inside any panel/etc.." I want to display all my xaml files/controls to display in one page. Please advice me if it is possible.

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

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-06-18 6:49:01 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search