Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluent Theme: ToolTip inherits style from TextBlock #9973

Open
bent-rasmussen opened this issue Oct 17, 2024 · 0 comments
Open

Fluent Theme: ToolTip inherits style from TextBlock #9973

bent-rasmussen opened this issue Oct 17, 2024 · 0 comments
Labels
Investigate Requires further investigation by the WPF team. Win 11 Theming

Comments

@bent-rasmussen
Copy link

bent-rasmussen commented Oct 17, 2024

Description

In the new .NET 9 Fluent theme, setting setting e.g. font weight on a TextBlock will cause its tooltip to have the same style. This is of course undesirable. It could be that other controls are affected as well, I have only tested with TextBlock.

Reproduction Steps

  • Create a .NET 9 WPF application
  • Change the MainWindow.xaml like so:
<Window
    x:Class="ScrollViewerTextWrapping.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:local="clr-namespace:ScrollViewerTextWrapping"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="MainWindow"
    Width="400"
    Height="200"
    ThemeMode="Light"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <Grid>

        <TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            FontWeight="Bold"
            ToolTip="This is a tooltip">
            This is not a tooltip
        </TextBlock>

    </Grid>
</Window>

Expected behavior

ToolTip styling is independent of TextBlock.

Image

Actual behavior

ToolTip styling "inherits" from TextBlock.

Image

Regression?

Prior versions of .NET as well as .NET 9 when not using the Fluent theme does not exhibit this issue.

Known Workarounds

Introducing a nested Run element with the style, like so:

<TextBlock
    HorizontalAlignment="Center"
    VerticalAlignment="Center"
    ToolTip="This is a tooltip">
    <Run FontWeight="Bold">This is not a tooltip</Run>
</TextBlock>

Impact

Degrades UX of tooltips.

Configuration

Property Value
SDK .NET 9 RC2
OS Name Microsoft Windows 11 Pro
Version 10.0.22631 Build 22631
System SKU Surface_Pro_8_1983

Other information

No response

@bent-rasmussen bent-rasmussen changed the title Fluent Theme: Tooltip inherits style from TextBlock Fluent Theme: ToolTip inherits style from TextBlock Oct 17, 2024
@himgoyalmicro himgoyalmicro added Investigate Requires further investigation by the WPF team. Win 11 Theming labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team. Win 11 Theming
Projects
None yet
Development

No branches or pull requests

2 participants