简体   繁体   中英

Wp7 Textblock right side of text

WP7 textblock

In my app, I have one screen which acts like dialer in which the user presses various buttons and a texblock gets updated with digits the user pressed.

The problem I'm facing is if a user presses 15-16 times, I can't see the last digits pressed by the user. I know I can use the text wrap property but I don't want my textblock to be multiline.

So somehow I want my textblock to always shows the last pressed digits, like to the right side of textblock, similarly to what is done in native apps when a user press a digits dialer. Any idea how to do that?

My idea would be to have an array of chars and when the user presses a Button, just add the corresponding character(s) to the beginning of the character array. Then just update the binding for the TextBox's Text.

This will ensure that the chronologically last character(s) will appear first in the UI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM