9

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!

Laith
  • 6,071
  • 1
  • 33
  • 60

1 Answers1

19

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

<x:Double>550</x:Double>
Shawn Kendrot
  • 12,425
  • 1
  • 25
  • 41
  • 5
    Seriously, thank you. It's all of these tiny, stupid, unnecessary changes that make Win8 development frustrating as heck for WPF/Silverlight devs. – Martin Doms Dec 11 '12 at 21:59