胡玮文
胡玮文

Reputation: 98

How can I use x:Static with x:String

I want something like:

<Picker>
     <Picker.Items>
         <x:String>{x:Static local:SomeClass.ConstText}</x:String>
     </Picker.Items>
</Picker>

Is this possible?

Upvotes: 0

Views: 229

Answers (1)

Sharada
Sharada

Reputation: 13601

Because x:Static is a markup extension, you can use it either through attribute usage, or element usage

For example, try this:

<Picker>
    <Picker.Items>
        <x:Static Member="local:SomeClass.ConstText" />
    </Picker.Items>
</Picker>

Upvotes: 3

Related Questions