-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
InvestigateRequires further investigation by the WPF team.Requires further investigation by the WPF team.Win 11 Theming
Description
Description
The DefaultToggleButtonStyle
doesn't bind ContentTemplate
to the ContentPresenter
like DefaultButtonStyle
does in the Fluent theme (I haven't looked at other themes).
Reproduction Steps
Create a window in a WPF app configured to use the Fluent theme with the following code:
<Window ...>
<Window.Resources>
<DataTemplate x:Key="ReplaceTextTemplate">
<TextBlock Text="Replaced text" />
</DataTemplate>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="ContentTemplate" Value="{StaticResource ReplaceTextTemplate}" />
</Style>
<Style TargetType="ToggleButton" BasedOn="{StaticResource DefaultToggleButtonStyle}">
<Setter Property="ContentTemplate" Value="{StaticResource ReplaceTextTemplate}" />
</Style>
</Window.Resources>
<StackPanel>
<Button Content="Hello" />
<ToggleButton Content="Hello" />
</StackPanel>
</Window>
Expected behavior
The content in the Button and ToggleButton should match and say "Replaced text".
Actual behavior
The Button says "Replaced text", but the ToggleButton still says "Hello".
Regression?
No response
Known Workarounds
No response
Impact
It makes configuring the ToggleButton more difficult and is inconsistent with the behavior of Button.
Configuration
No response
Other information
No response
lindexi
Metadata
Metadata
Assignees
Labels
InvestigateRequires further investigation by the WPF team.Requires further investigation by the WPF team.Win 11 Theming