gamlieldor gamlieldor - 1 year ago 154
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 (


Answer Source


<x:Static Member="sys:String.Empty" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download