Skip to content

XAML won't render left curly bracket in button content #3000

@JeroenOortwijn

Description

@JeroenOortwijn
  • .NET Core Version: 3.1.202
  • Windows version: 10.0.18363
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? Yes, filed a bug report, but it was closed and redirected here.

Problem description:

XAML designer won’t show left curly bracket if it’s defined with its decimal reference.

Actual behavior:

image

Building gives the following build error:

Error
MC3074
The tag '' does not exist in XML namespace https://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 13 Position 17.

Expected behavior:

image

Minimal repro:

<Window x:Class="Accolade_xaml_test.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"
        xmlns:local="clr-namespace:Accolade_xaml_test"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <WrapPanel>
        <Button Content="&#120;" FontSize="40" Width="40"/>
        <Button Content="&#121;" FontSize="40" Width="40"/>
        <Button Content="&#122;" FontSize="40" Width="40"/>
        <Button Content="&#123;" FontSize="40" Width="40"/> <!-- This should show left curly bracket { -->
        <Button Content="&#124;" FontSize="40" Width="40"/>
        <Button Content="&#125;" FontSize="40" Width="40"/>
        <Button Content="&#126;" FontSize="40" Width="40"/>
    </WrapPanel>
</Window>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions