mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
Backport the fix to prop precedence from .NET to Framework (#1171)
* Update page4.xaml * Update page4.xaml * Add snippet * Change reference
This commit is contained in:
+24
-21
@@ -4,27 +4,30 @@
|
||||
x:Class="MyNamespace.MyCode"
|
||||
Loaded="BAQ"
|
||||
>
|
||||
<StackPanel>
|
||||
<!--<SnippetAPBasicUsage>-->
|
||||
<DockPanel>
|
||||
<CheckBox DockPanel.Dock="Top">Hello</CheckBox>
|
||||
</DockPanel>
|
||||
<!--</SnippetAPBasicUsage>-->
|
||||
<Button Click="MakeANewThing">Make a new thing</Button>
|
||||
<!--<SnippetDPPrecedence>-->
|
||||
<Button Background="Red">
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="Green"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Blue" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
Click
|
||||
</Button>
|
||||
<StackPanel>
|
||||
<StackPanel.Resources>
|
||||
<ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</StackPanel.Resources>
|
||||
|
||||
<Button Template="{StaticResource ButtonTemplate}" Background="Red">
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="Blue"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Yellow" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
Which color do you expect?
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<!--</SnippetDPPrecedence>-->
|
||||
</StackPanel>
|
||||
</Canvas>
|
||||
|
||||
Reference in New Issue
Block a user