Der PROPERTY-Trigger

 

 

MainWindow.xaml:

<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="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>Funktion 1</ListBoxItem>
<ListBoxItem>Funktion 2</ListBoxItem>
<ListBoxItem>Funktion 3</ListBoxItem>
<ListBoxItem>Funktion 4</ListBoxItem>
<ListBoxItem>Funktion 5</ListBoxItem>
</ListBox>

</Grid>
</Window>

 

Top