2

I'am trying to create an array of strings which will be set by a static reference to the project's resource file (I use this for localization):

<x:Array Type="{x:Type sys:String}" x:Key="FormatTranslation">
    <sys:String>{x:Static p:Resources.Yes}</sys:String>
    <sys:String>{x:Static p:Resources.No}</sys:String>
</x:Array>

Of course the code above does not work, it just shows the referencce as string.

How can I bind those values to the string entities?

--- Update 1 ---

The array is defined in

<UserControl.Resources>

This is the line where I'am referencing the array as a StaticResource to use it as ConverterParameter

<TextBlock Text="{Binding RowData.Row.IsLandscapeFormat, Converter=StaticResource BCBCT}, ConverterParameter={StaticResource FormatTranslation}}"/>
2
  • Add the snipped you use this Array please. Commented Apr 12, 2016 at 15:12
  • @Fruchtzwerg Please see Update 1 Commented Apr 13, 2016 at 6:53

1 Answer 1

4

Add the Static values directly to your array.

<x:Array Type="sys:String">
  <x:Static Member="p:Resources.Yes"/>
  <x:Static Member="p:Resources.No"/>
</x:Array>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.