UWP - Binding Overflow Variables

I ran into a very interesting problem.

Suppose you have the following contents of a XAML page in a UWP application:

<ContentControl Content="{x:Bind ApplicationDataLocalityEnum}" />
<ContentControl Content="{x:Bind FontStyleEnum}" />

And at the code end of the page contains the following properties:

    public ApplicationDataLocality ApplicationDataLocalityEnum { get; } =
               ApplicationDataLocality.Local;

    public FontStyle FontStyleEnum { get; } = 
               FontStyle.Normal;

The expected result will be that the application will display "Local" and "Normal".

The actual result, however, is as follows:

enter image description here

What is the reason for this? I am very curious, but although I tried for a long time to delve into the values ​​of the debugger, he never found anything that could cause this.

You can play with my sample project on GitHub .

+4
source share
1

FontStyle ( F12), Windows.Foundation.UniversalApiContract.winmd. .NET, , .NET. MSDN IReference :

.NET , Nullable. Runtime Windows, IDL IReference ( ), NULL (,? Bool).

, ?

, .NET .NET. ToString() , enum, GetType().ToString(), , .

?

, , . , ToString() GetType().ToString(), ; .

+2

Source: https://habr.com/ru/post/1653481/


All Articles