Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an Array in WinRT XAML

I am looking to declare an array in XAML. I can do this in WPF. Just can't seem to find the right namespace in WinRT. Anyone know?

<Page xmlns:list="?Something?">

    <Page.Resources>

        <x:Int32 x:Name="MyScalarValue">123</x:Int32>

        <list:Array x:Name="MyValueList">
            <x:Int32>123</x:Int32>
            <x:Int32>456</x:Int32>
        <list:Array>

    </Page.Resources>

</Page>
like image 893
Jerry Nixon Avatar asked Oct 23 '22 22:10

Jerry Nixon


1 Answers

x:Array (and x:Static and a few other ones) aren't presently supported in WinRT. For that matter, x:Array isn't supported in Silverlight either, despite developers pushing for it.

Given the fact that the XAML implementation for WinRT appears to be more closely aligned with SL than WPF, this isn't too surprising.

Edit - some more info regarding SL4+ vs. WPF differences:
"Notable omissions here that exist in WPF or [MS-XAML] are x:Array, x:Code, x:Type, and code access modifiers."

Also, a delta between SL4 and the WinRT implementation here, and its associated links, makes it clear that these bits didn't magically make it into WinRT when they were (and still are) omitted from SL.

like image 101
SWalters Avatar answered Nov 25 '22 02:11

SWalters