This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have a simple object with public properties of string and one enum type. The constructor of my object has all the properties initialized, so no values have null or return nothing... When i bind this object to the propertygrid, I am receiving an "object is null" message thrown from the presentationframework, after it apparently tries to bind the object. I can see all the property "Get" methods fire, and then it repeatedly calls the "Text" method on the object, and blows up right after the eighth call to the Text property. Coincidently, when I first run the program set to break on all exceptions, i receive this message from the Managed Exceptions: Managed Debugging Assistant 'BindingFailure' has detected a problem in 'C:\Documents and Settings\mcain\My Documents\Visual Studio 2005\Projects\ScreenDesigner\ScreenDesigner\bin\ScreenDesigner.vshost.exe'. === Pre-bind state information ===
I can continue through this error and my screen paints fine, but when I bind, it blows up...
|
|
|
Thanks for reporting this. I have tried to reproduce this behaviour but without success. Could you send me a sample that reproduces the problem, or at least a stack trace from the exception? Thanks! Regarding your other observations: The FileNotFoundException that you see is, I believe, a benign first-chance exception. It is an artefact of the way WPF searches for the Classic theme -- basically it tries to locate a theme assembly first, and only when this fails does it fall back to the main assembly (which is where the Classic theme is in the WPF Property Grid). The repeated calls to the Text property are an artefact of the way that the WPF Property Grid tries to determine the right editor to use for any given property. Currently it examines the run-time value for some information that it could actually have got from the static type information. We have a fix for this but we need to test it a bit more. Unless your property getters are doing work which is expensive or might fail (e.g. connecting to a database) the repeated calls should not be a problem (except of course for being annoying to debug!). Thanks for alerting us to this. |
|
|
Thanks for looking at this Ivan -
I was able to solve this by applying .Net Framework 3.0 SP1 to my machine. Apparently it is something going on in the PresentationFramework. Do you still want to see a sample of the problem?
|
|
|
No, that's great. Now you mention it I remember we have seen this exact same issue before (http://www.mindscape.co.nz/forums/Thread.aspx?ThreadID=1151), but I'd completely forgotten the symptom! We will definitely be adding a check for SP1 to the installer! |
|