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

Built-in System Data Types

In XAML2006, using core .NET data types such as String or Int32 in WPF is awkward due to the need to reference the System namespace from the mscorlib assembly, as seen previously in this chapter:

<sys:Int32 xmlns:sys="clr-namespace:System;assembly=mscorlib">7</sys:Int32>

Similar to the four keywords that enable Windows Store and universal apps to reference some primitive types, XAML2009 enables the same thing for WPF. However, it supports thirteen .NET data types in the XAML language namespace. With a namespace prefix of x, these data types are x:Byte, x:Boolean, x:Int16, x:Int32, x:Int64, x:Single, x:Double, x:Decimal, x:Char, x:String, x:Object, x:Uri, and x:TimeSpan.

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