dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
6.84k stars 1.13k forks source link

The left arrow (<) inside ToolTip property throws an "White space is missing" error #9016

Closed lucas404x closed 1 month ago

lucas404x commented 1 month ago

Description

I was trying to put into the tooltip the shortcuts to access an specific button. The thing is that the left arrow "<" is throwing an "White space is missing" error. Maybe it's thinking that I'm creating a new xaml element? I don't know, but the right arrow (>) works well.

The element:

 <Button IsEnabled="{Binding EnablePreviousBtn, UpdateSourceTrigger=PropertyChanged}" Background="{x:Null}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" ToolTip="Clique para voltar ao tópico anterior (LEFT ALT + <-)" Width="24" Height="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,0,5" Click="btnPrevHelp_Click">
  <Path Data="{Binding Source={x:Static PathDataLib:Common.PathNavPrevious}}" Stretch="Uniform" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Button}},Path=Foreground}" />
 </Button>

The tooltip:

ToolTip="Clique para voltar ao tópico anterior (LEFT ALT + <-)"

Reproduction Steps

Expected behavior

No errors.

Actual behavior

"White space is missing" error

Regression?

No idea

Known Workarounds

I don't have one

Impact

It's not critical, just weird and annoying

Configuration

Which version of .NET is the code running on? 4.7.2 What OS and version, and what distro if applicable? Windows 11 Pro 23H2, Build 22631.3447 What is the architecture (x64, x86, ARM, ARM64)? x64 Do you know whether it is specific to that configuration? No

Other information

No response

miloush commented 1 month ago

This is not valid XML. Use &lt;

https://learn.microsoft.com/en-us/dotnet/desktop/xaml-services/xml-character-entities

lucas404x commented 1 month ago

Oh, my bad. Thank you so much, @miloush !