【问题标题】:How to add an Array in WinRT XAML如何在 WinRT XAML 中添加数组
【发布时间】:2012-05-22 14:48:20
【问题描述】:

我希望在 XAML 中声明一个数组。我可以在 WPF 中做到这一点。只是似乎无法在 WinRT 中找到正确的命名空间。有人知道吗?

<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>

【问题讨论】:

    标签: windows-8 winrt-xaml


    【解决方案1】:

    x:Array(以及 x:Static 和其他一些)目前在 WinRT 中不受支持。就此而言,Silverlight 也不支持 x:Array,despite developers pushing for it

    鉴于 WinRT 的 XAML 实现似乎是 more closely aligned with SL than WPF,这不足为奇。

    编辑 - 关于SL4+ vs. WPF differences的更多信息:
    “在 WPF 或 [MS-XAML] 中存在的显着遗漏是 x:Array、x:Code、x:Type 和代码访问修饰符。”

    此外,SL4 和 WinRT 实现 here 之间的差异及其相关链接清楚地表明,当这些位被(并且仍然)从 ​​SL 中省略时,它们并没有神奇地进入 WinRT。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-12
      相关资源
      最近更新 更多