FriendlyName in PropertyStatus issue 851 question

FriendlyName in PropertyStatus issue 851 question

Old forum URL: forums.lhotka.net/forums/t/9682.aspx


artsd posted on Tuesday, October 26, 2010

Just today I was hoping to be able to do XAML binding to a property's friendly name when I found issue 851.

http://www.lhotka.net/cslabugs/edit_bug.aspx?id=851

The last comment mentions poor visual results I am guessing because if the XAML is bound to a null object you won't even get labels, let alone the data.

Even with that limitation, I still think this feature would be very worthwhile.

Any idea if this feature will make it in subsequent release?

Are these type changes available somewhere in src format so I could pull the change myself and experiment with it?

Thanks!

RockfordLhotka replied on Wednesday, October 27, 2010

This idea came about while I was working with a Magenic client, and it is a good idea. We prototyped it though, and the UI results were not good. The form paints essentially blank, and then the data fills in, and then the label text fills in (as PropertyChanged events fire when the data arrives). It really looks weird.

We didn't keep the code - it is only about 4-6 lines - just reflect against the Source object to find the Binding property and grab its Display attribute value - that was what we did in the prototype anyway.

However, there's a possible solution, and that is to give PropertyStatus the type of the business class. If it had that information it could go direct against the static fields and/or attributes of the type to get the metadata. In WPF this wouldn't be hard - just add a "SourceType" property to PropertyStatus so you could tell it the type of the source object. Silverlight doesn't have (unless it is a recent addition) the x:Type concept though, so we'd have to invent something there.

Copyright (c) Marimer LLC