O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Type Converters

Chapter 1, “What Is XAML?” showed the following Button with two properties set using property attributes:

<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  Content="Stop" Background="Red"/>

and using property elements:

<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">  <Button.Content>    Stop  </Button.Content>  <Button.Background>    Red  </Button.Background></Button>

Let’s look at the equivalent C# code, in the context of Windows Store and universal apps:

Windows.UI.Xaml.Controls.Button b = new Windows.UI.Xaml.Controls.Button();b.Content = "Stop";b.Background = new Windows.UI.Xaml.Media. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required