microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Question: How to right-align numbers in NumberBox in Reunion 0.5?

Open jschwizer99 opened this issue 3 years ago • 3 comments

When updating from Reunion.WinUI.0.5.0-prerelease to Reunion.WinUI.0.5.0 I've noticed that the NumberBox property TextAlignment is no more available (compilation fails). I've used in past WinUI releases TextAlignment="Right" to achieve a pleasant-looking vertically aligned number alignment. Without this alignment, numbers are much harder to read for a user.

The removal did not come as a full surprise as there was already a deprecated message in the Reunion 0.5 preview.

Is there replacement functionality in WinUI Reunion to get numbers in NumberBox fields correctly right-aligned? Any hint is highly appreciated.

jschwizer99 avatar Mar 30 '21 09:03 jschwizer99

NumberBox's TextAlignment property is currently still in preview: https://github.com/microsoft/microsoft-ui-xaml/blob/91b6038d571be8116012d813af06510a2b76905a/dev/NumberBox/NumberBox.idl#L72 which is why it wasn't included in the Reunion.WinUI.0.5.0. If you need this in your app right now you can retemplate numberbox to add the TextAlignment to the internal textbox, of you VisualTreeHelper to walk the visual tree down to the textbox and set the alignment from code. Sorry!

@SavoySchuler FYI

StephenLPeters avatar Mar 30 '21 23:03 StephenLPeters

@StephenLPeters Many thanks for the good news! Not sure if I will spend here the effort of creating my own control as there are currently other places that also need similar efforts for workarounds e.g. cursor pointers. Is there somewhere an accessible list in which all these features are tracked so that they do not get forgotten in the next release(s)? The high-level WinUI roadmap does currently not reflect well the missing / preview functionality.

jschwizer99 avatar Mar 31 '21 08:03 jschwizer99

Waiting for this in WASDK 1.1.

bogdan-patraucean avatar Jul 22 '22 10:07 bogdan-patraucean