views:

310

answers:

0

I working on a Silverlight app that includes an screen emulator for a handheld device. The idea is that a user can attempt to format text that will display on the device, and see how it will look on the screen. The emulator also attempts to make a "best guess" at formatting a string to fit the device screen. I know I can do the math myself and determine where I should add a line break to the text that will be rendered via a TextBlock, but I'm wondering if there's a way to set the wrap attribute on the TextBlock, dump in the text, and then determine where the runtime breaks the text, and format it for the device appropriately.

related questions