Browse by Tags

Markup extensions
Mon, Nov 23 2009 12:26
Markup extensions allows you to extend the expressibility of XAML. You use markup extensions to escape the general treatment that attribute values get (by default, we’ve seen that they are treated as strings or that a type converter is used to convert them to the adequate type). Markup extension expressions are always delimited by the pair { }. Currently, the... Read More...
by luisabreu | with no comments
Filed under: ,
XAML: what about events?
Thu, Nov 19 2009 12:54
A friend of mine asked me about events and XAML: can we setup event handlers in XAML? And the answer is, yes, you can. Here’s a quick example of how you can handle the click event of a button: < Button Click = "Button_Click" ></ Button > And yes, you must define the Button_Click method in your code-behind file (note that you could do it... Read More...
by luisabreu | with no comments
Filed under: ,
How to build types that can be consumed from XAML
Thu, Nov 19 2009 10:32
Now that you know how to use custom types in XAML, you might be wondering if there are any thing you should keep in mind when designing new types that should be consumed from XAML. I’ve already said before that collection properties need to have a getter that return a valid instance of an object. But there’s more. Here are a few things you should consider when... Read More...
by luisabreu | with no comments
Filed under: ,
Associating XAML namespaces to CLR namespaces
Thu, Nov 19 2009 10:10
Take a look at the following (simple) XAML: < UserControl x : Class = "SilverlightApplication1.MainPage" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x = "http://schemas.microsoft.com/winfx/2006/xaml" > < Canvas x : Name = "myCanvas" > </ Canvas > </ UserControl > When... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
XAML languages features
Wed, Nov 18 2009 15:15
As I’ve said before, Silverlight supports only a subset of the existing XAML keywords you can use in WPF. Here’s the list of keywords you can use in your Silverlight: x:Class: you can apply this attribute to the root element of the XAML file (or object tree) that is going to be “compiled”. When you apply this attribute, you’ll end up creating a partial class... Read More...
by luisabreu | with no comments
Filed under: ,
XAML and collections
Wed, Nov 18 2009 12:13
We’ve already talked about several features related to XAML. In this post, we’ll keep going and we’ll see how to specify collections in XAML. There are two basic types of collections you can use in XAML: lists and dictionaries. Before going on, it’s important to understand that you’re not really creating new collections in XAML; instead, we’re adding items to... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
Type converter on Silverlight
Wed, Nov 18 2009 11:09
Today we’ll talk a little bit about the role played by type converters in “transforming” XAML into C# objects. Here’s a quick example: < Button xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x = "http://schemas.microsoft.com/winfx/2006/xaml" x : Name = "bt" Click = "bt_Click" Width = "100"... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
XAML: using content properties
Tue, Nov 17 2009 12:06
In the previous post , we’ve seen that we can use one of two approaches for setting the value of a property: we can use the property element or the attribute syntax (and, as we’ve seen in the previous post , you can’t use them both interchangeably). In this post , we’ll keep going and we’ll see how content properties simplify even more the markup we need to write... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
XAML and property elements
Tue, Nov 17 2009 10:20
In the previous post , we’ve started looking at same basic XAML. At the time, we’ve defined a simple button by using the following syntax: < Button xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x = "http://schemas.microsoft.com/winfx/2006/xaml" x : Name = "bt" Content = "Say hi" Click =... Read More...
by luisabreu | 2 comment(s)
Filed under: ,

Search

This Blog

Tags

Community

Archives

Syndication

Email Notifications

News




  • View Luis Abreu's profile on LinkedIn


    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover