C# 如何将x:Static与x:String一起使用
我想要像这样的东西:C# 如何将x:Static与x:String一起使用,c#,xaml,xamarin.forms,C#,Xaml,Xamarin.forms,我想要像这样的东西: <Picker> <Picker.Items> <x:String>{x:Static local:SomeClass.ConstText}</x:String> </Picker.Items> </Picker> {x:Static local:SomeClass.ConstText} 这可能吗?因为x:Static是一个标记扩展,您可以通过 例如,尝试以下
<Picker>
<Picker.Items>
<x:String>{x:Static local:SomeClass.ConstText}</x:String>
</Picker.Items>
</Picker>
{x:Static local:SomeClass.ConstText}
这可能吗?因为
x:Static
是一个标记扩展,您可以通过
例如,尝试以下方法:
<Picker>
<Picker.Items>
<x:Static Member="local:SomeClass.ConstText" />
</Picker.Items>
</Picker>
因为
x:Static
是一个标记扩展,所以您可以通过
例如,尝试以下方法:
<Picker>
<Picker.Items>
<x:Static Member="local:SomeClass.ConstText" />
</Picker.Items>
</Picker>
您尝试时发生了什么?@mjwills我的选择器中显示了一个字符串“{x:Static local:SomeClass.ConstText}”,您尝试时发生了什么?@mjwills我的选择器中显示了一个字符串“{x:Static local:SomeClass.ConstText}”