Am Mon, 4 May 2009 22:06:46 -0700 (PDT) schrieb Pavel Minaev:
Hello Pavel,
The following complete XAML code works for me in XamlPad (i.e. when I
click on the ComboBox, I see "Herr" and "Frau" in the dropdown):
tnx for trying this out. You are right, it works as expected, in XamlPad as
well s in VS. Maybe I found a problem in VS2008, because if I add another
resource BEFORE the array, it does not work any longer. For example this:
<Window.Resources>
<SolidColorBrush x:Key="br1" Color="Blue"></SolidColorBrush>
<x:Array x:Key="d" Type="sys:String">
<sys:String>Herr</sys:String>
<sys:String>Frau</sys:String>
</x:Array>
</Window.Resources>
<StackPanel>
<ComboBox ItemsSource="{StaticResource d}"></ComboBox>
</StackPanel>
does NOT work in VS2008. It works in XamlPad, however.
I fiddled a little bit around, and I found that it depends on whether the
x:Array is the FIRST resource added. If this is not the case, it does not
work!
Any ideas?
And:
It needs not be. x:Array is in many ways magical, and this is one of
them. The property will see the actual IEnumerable array in this case,
not the extension.
yes, yes,.... my fault. ProvideValue of the ArrayExtension class returns a
string array, which should work. I was confused by the error message VS
gave to me.
Greetz
wpf rookie