question

RodFalanga avatar image
0 Votes"
RodFalanga asked ·

Does decimal still not bind to textboxes?

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?

windows-uwpwindows-uwp-xaml
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardZhang-MSFT avatar image
1 Vote"
RichardZhang-MSFT answered ·

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


· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RodFalanga avatar image
0 Votes"
RodFalanga answered ·

Really? How very interesting. Thank you, Richard.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.