Does decimal still not bind to textboxes?

Rod Falanga 561 Reputation points
2020-03-07T15:34:54.777+00:00

I know that in the past it wasn't possible to bind a decimal data type to a textbox in a UWP app. You had to use float instead. Is that restriction still true?

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Richard Zhang-MSFT 6,936 Reputation points
    2020-03-09T01:50:59.397+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    I tried to create a decimal variable and simple binding:

    xaml

    <Grid>  
         <TextBox Text="{x:Bind value}"/>  
     </Grid>  
    

    xaml.cs

    public decimal value = 10;  
       
     public MainPage()  
     {  
         this.InitializeComponent();  
     }  
    

    It can be displayed successfully, so the It can be displayed successfully, so the TextBox should be able to bind decimal data. should be able to bind decimal data.

    Thanks

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rod Falanga 561 Reputation points
    2020-03-10T01:11:56.87+00:00

    Really? How very interesting. Thank you, Richard.

    0 comments No comments