gamlieldor gamlieldor - 3 months ago 42
C# Question

XAML static string array with empty string

I have a combo box in my WPF application with a static item source (HTTP methods)

<ComboBox x:Name="methodsComboBox" Width="120"
ItemsSource="{StaticResource ResourceKey=Methods}"
SelectedItem="{Binding Object.Method, Mode=TwoWay}"/>

The static resource is a string array and looks like this:

<x:Array x:Key="Methods" Type="{x:Type sys:String}">

How can I put an empty string inside so I will have a default value for my combo box? Something like this:

<sys:String> </sys:String>

When I do this, I get a runtime error (




<x:Static Member="sys:String.Empty" />