Use ViewModelListBox dynamic resource.

This commit is contained in:
Daniel Kraus 2015-08-04 06:25:13 +02:00
parent 8d6ed32a84
commit 33d453cf73

View File

@ -26,16 +26,7 @@
Title="Stil auswählen"
>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/zaaReloaded2;component/style.xaml" />
<ResourceDictionary>
<Style x:Key="settingsListItem" TargetType="{x:Type ListBoxItem}">
<Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Margin="10">
<Label Target="{Binding ElementName=settingsList}">Bitte Stil auswählen:</Label>
@ -51,7 +42,7 @@
<StackPanel>
<ListBox ItemsSource="{Binding SettingsList}"
DisplayMemberPath="Name"
ItemContainerStyle="{StaticResource settingsListItem}"
ItemContainerStyle="{DynamicResource ResourceKey=ViewModelListBox}"
x:Name="settingsList"
MinWidth="240" MinHeight="240" />
</StackPanel>