<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="Brush_GridBackground" TargetType="{x:Type Grid}"> <Style.Triggers> <multidatatrigger> <multidatatrigger.conditions> <condition binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="Red" /> <condition binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="White" /> <condition binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="Black" /> <condition binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="Blue" /> <condition binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="Green" /> </multidatatrigger.conditions> <setter property="Background" value="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" /> </multidatatrigger> </Style.Triggers> </Style> </resourcedictionary>
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="Brush_GridBackground" TargetType="{x:Type Grid}"> <Style.Triggers> <datatrigger binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="Red"> <setter property="Background" value="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" /> </datatrigger> <datatrigger binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="White"> <setter property="Background" value="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" /> </datatrigger> <datatrigger binding="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" value="Black"> <setter property="Background" value="{Binding ElementName=cb_BackgroundColor, Path=SelectedItem.Tag}" /> </datatrigger> </Style.Triggers> </Style> </resourcedictionary>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)