Der MULTI-Trigger

 

 

<Window x:Class="PropertyTrigger.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PropertyTrigger"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style x:Key="listboxitemstil_over" TargetType="ListBoxItem">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="FontSize" Value="16" />
</MultiTrigger>
</Style.Triggers>
</Style>

<Style x:Key="listboxstil" TargetType="ListBox">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="LightCoral" />
</Trigger>
</Style.Triggers>
<Setter Property="Width" Value="250" />
<Setter Property="Height" Value="250" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="LightGray" />
</Style>
</Window.Resources>
<Grid Background="BlanchedAlmond">
<ListBox Style="{StaticResource listboxstil}">
<ListBoxItem Style="{StaticResource listboxitemstil_over}">Funktion 1</ListBoxItem>
<ListBoxItem Style="{StaticResource listboxitemstil_over}">Funktion 2</ListBoxItem>
<ListBoxItem Style="{StaticResource listboxitemstil_over}">Funktion 3</ListBoxItem>
<ListBoxItem Style="{StaticResource listboxitemstil_over}">Funktion 4</ListBoxItem>
<ListBoxItem Style="{StaticResource listboxitemstil_over}">Funktion 5</ListBoxItem>
</ListBox>

</Grid>
</Window>

Top