Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAML Primitives in WinRT / Win8 Metro

Has anyone been able to add primitives in XAML in WinRT? I'm trying to run the following, which is standard in all XAML-based technologies except for WinRT:

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:System="using:System">

    <System:Double x:Key="MyWidth">550</System:Double>

</ResourceDictionary>

This does not show an error in Visual Studio, but it will throw a XamlParseException with a message "The type 'Double' was not found..."

Thanks!

like image 483
Laith Avatar asked Sep 17 '12 06:09

Laith


1 Answers

The namespace for system types have been replaced with 'x'

<x:Double>550</x:Double>
like image 169
Shawn Kendrot Avatar answered Jan 03 '23 17:01

Shawn Kendrot