Mega Code Archive

 
Categories / C# / WPF
 

Ignore an Implicit Style by setting Style to Null

<Window x:Class="WpfApplication1.Window1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:WpfApplication1="clr-namespace:WpfApplication1;assembly="     Title="WPF" Height="88" Width="180">     <Window.Resources>         <Style TargetType="{x:Type Button}">             <Setter Property="Background" Value="LightGray"/>             <Setter Property="FontWeight" Value="Bold"/>         </Style>     </Window.Resources>     <StackPanel Margin="4">         <Button>Implicit Style</Button>         <Button Style="{x:Null}">Ignores Style</Button>     </StackPanel> </Window>