Я использую следующие массивы в качестве параметров для моего преобразователя значений. Я не могу понять, почему «params2» передается как ArrayExtension, а «params1» передается как простой массив TextBlock [].
<Window.Resources>
<x:Array Type="TextBlock" x:Key="params1">
<TextBlock Text="{x:Static local:Constants.MyDir}"></TextBlock>
<TextBlock>25</TextBlock>
</x:Array>
</Window.Resources>
<TabItem.Resources>
<x:Array Type="TextBlock" x:Key="params2">
<TextBlock Text="{x:Static local:Constants.MyDir}"></TextBlock>
<TextBlock>55</TextBlock>
</x:Array>
</TabItem.Resources>
Просмотрщик изображений XAML:
<Window x:Class="TotalViewer.ImageViewerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TotalViewer"
Title="ImageViewerWindow" Name="ImageViewerWindow1">
<Window.Resources>
<x:Array Type="TextBlock" x:Key="params1">
<TextBlock Text="{x:Static local:Constants.MyDir}"></TextBlock>
<TextBlock>25</TextBlock>
</x:Array>
</Window.Resources>
<Grid>
<Image Source="{Binding ElementName=ImageViewerWindow1, Path=ImagePath,
Converter={StaticResource ImageConverter},
ConverterParameter={StaticResource params1}}"/>
</Grid>
</Window>