mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* Add new snippet for dependency precedence article * Add article * Minor edits * Update dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md Co-authored-by: Andy (Steve) De George <[email protected]> * Update dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md Co-authored-by: Andy (Steve) De George <[email protected]> * Make reviewer requested changes * Revert "Add new snippet for dependency precedence article" This reverts commit 11657c18bdf9b8ed8037e689b84be643d7e7b9e7. * Fix snippet path * Remove unneeded code project files * Header edit * Update dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md Co-authored-by: Andy (Steve) De George <[email protected]> * Remove VB code project * Redirects Co-authored-by: Andy (Steve) De George <[email protected]> Co-authored-by: Andy De George (adegeo) <[email protected]>
35 lines
1.6 KiB
XML
35 lines
1.6 KiB
XML
<Window x:Class="CodeSampleCsharp.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"
|
|
mc:Ignorable="d"
|
|
Title="Dependency Property Value Precedence" Height="100" Width="300">
|
|
<!--<DependencyPropertyValuePrecedence>-->
|
|
<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>
|
|
<!--</DependencyPropertyValuePrecedence>-->
|
|
</Window>
|