microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.34k stars 677 forks source link

Non-alphanumeric characters are ignored in x:Bind path #4735

Open kodaru opened 3 years ago

kodaru commented 3 years ago

Describe the bug The non-alphanumeric property name is not recognized in the x: Bind path and cannot be built.

Steps to reproduce the bug

  1. Create a Blank App (Universal Windows)
  2. Insert the code below and build
    MainPage.xaml.cs
    public sealed partial class MainPage : Page {
    public ViewModel ViewModel { get; } = new ViewModel();
    }
    public class ViewModel {
    public string A { get; }
    public string あ { get; }
    public string Bい { get; }
    public string うC { get; }
    }
    MainPage.xaml
    <Grid>
    <!-- OK -->
    <TextBlock Text="{x:Bind ViewModel.A}"/>
    <!-- Error -->
    <TextBlock Text="{x:Bind ViewModel.あ}"/> <!-- Invalid binding path 'ViewModel.あ' : Syntax error at '<EOF>' -->
    <TextBlock Text="{x:Bind ViewModel.Bい}"/> <!-- Invalid binding path 'ViewModel.Bい' : Property 'B' not found on type 'ViewModel' -->
    <TextBlock Text="{x:Bind ViewModel.うC}"/> <!-- Invalid binding path 'ViewModel.うC' : Property 'C' not found on type 'ViewModel' -->
    </Grid>

Expected behavior No build error

Version Info Windows app type: UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context I'm trying to migrate WPF to UWP, However, I can't use x:Bind because there are so many Japanese property names in this project.

StephenLPeters commented 3 years ago

@fabiant3 and @RealTommyKlein FYI.