Some labels has "jumping" positions


Some labels "jump" to a wrong position if not every label field is set. See attached files for a sample.

file attachments


HillHouse wrote Feb 27, 2012 at 3:21 AM

I expect to resume some work on this project in the coming week - I'll look into the jumping positions - looks easy to replicate thanks to your example.

Tomboy wrote Feb 27, 2012 at 12:40 PM

I would suggest to use a label per field instead of onle textblock for the whole texts (not considering performance loss). This will give you the ability to colorize / increase opacity of a label without filling the gap that has no text (label value not set).

HillHouse wrote Mar 15, 2012 at 3:21 AM

Tracked the jumping down to a change made quite some time ago. There is an old picture on the web site that illustrates the correct label position in the GraphicsTest Labels panel. I've fixed the problem locally and expect to check in an update this weekend once I've implemented a unit test to replicate the problem - probably count the number of new lines in the label.

With respect to setting individual properties on labels, I've added the ability to specify a Run for a label. So for example,

"K:<Run Foreground='Green' FontWeight='Bold' FontStyle='Italic'>KK</Run>;"

will cause the K label to appear as bold, green, and italic. One might argue that this approach violates MVVM since we're mixing display attributes (view) with labels (model). However, one could also argue that this is actually output from a value converter, specifically for the view.

wrote Feb 14, 2013 at 6:22 PM