Wpf 如何更改Microsoft架构版本

Wpf 如何更改Microsoft架构版本,wpf,xml-namespaces,Wpf,Xml Namespaces,直到现在,xlmns:x对我来说似乎并不重要,但现在我喜欢创建一个带有“x:String”类型数组的ResourceDictionary。 默认xlmns:x命名空间引用版本2006,但不支持字符串。从2009年开始。所以我喜欢使用更新的版本。 完成它需要哪些步骤 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2009/xaml/presentation" xmlns:x=

直到现在,xlmns:x对我来说似乎并不重要,但现在我喜欢创建一个带有“x:String”类型数组的ResourceDictionary。 默认xlmns:x命名空间引用版本2006,但不支持字符串。从2009年开始。所以我喜欢使用更新的版本。 完成它需要哪些步骤

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2009/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                    xmlns:local="clr-namespace:HMBFipsReminderUI">
    <x:Array x:Key="DataGrid_SampleItemSource" Type="x:String">

    </x:Array>
</ResourceDictionary>

重命名没有帮助,因为visual studio找不到命名空间。1是否有添加此命名空间的选项

  • 如何更改默认版本?因此,在创建新资源、页面等时,将使用新名称空间

  • String
    mscorlib
    程序集的
    System
    命名空间中的一种类型:

    xmlns:s="clr-namespace:System;assembly=mscorlib"
    
    试试这个:

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                xmlns:local="clr-namespace:HMBFipsReminderUI"
                                xmlns:s="clr-namespace:System;assembly=mscorlib">
        <x:Array x:Key="DataGrid_SampleItemSource" Type="{x:Type s:String}">
            <s:String>a</s:String>
            <s:String>b</s:String>
            <s:String>c</s:String>
        </x:Array>
    </ResourceDictionary>
    
    
    一
    b
    c