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
|
Hi, I've been kicking the grid around in a mockup app. I'd like to say I'm very impressed. However, I'm now attempting to port this app to XBAP project and every time I try to run this or even a fresh XBAP project with a property grid on a page I get the following: System.Windows.Markup.XamlParseException was unhandled Of course, removing the grid fixes the problem. Does this have to do with partial trust? And please tell me that this great control can work in a sandboxed environment. Thanks, Kavan |
|
|
Hi Again, In my haste, I failed to notice the following in the VS output: Reference 'Mindscape.WpfPropertyGrid' does not allow partially trusted callers. As a side, I was getting this for some my helper assemblies, and a simple project setting change solved it. Although, if reflection of non-public members or something Full-Trust is happening by the grid than the solution will be a bit more involved. Thanks again, Kavan
|
|
|
Hi Kavan, I'm afraid this is a limitation of the present version of the grid. As you can imagine it does do quite a lot of reflection, though almost all of this is over public members. I will look into the feasibility of supporting partial trust and the XBAP environment and get back to you. Cheers, Ivan |
|
|
Well, that was an interesting journey *grin*. At heart, we can make the grid work in partial trust scenarios (we need to make some minor changes to the code, along the lines of APTCA and security metadata, but these are no big deal). *However*, some of our customers require support for custom type descriptors, and in order to support these customers while keeping the API transparent, we have our own internal subclass of System.Reflection.PropertyInfo. And System.Reflection.PropertyInfo has an InheritanceDemand of FullTrust, meaning that only fully trusted assemblies are allowed to define derived types of PropertyInfo. We can work around this but it will probably entail compromises. Furthermore, because we get and set values through reflection (even of public members), I believe the grid won't run with the default LocalIntranet permission set, because this doesn't include the MemberAccess permission. Would partial trust still be useful to you if you had to request elevated permissions anyway, or would you think "well I might as well request full trust in that case"? |
|
|
Would you consider a possible satellite assembly to support the custom descriptors or maybe a stripped down version? In my scenerio the XBAP app is actually a config tool that the grid very quickly allows a UI to be generated for. I am also curious as to the need for subclassing property info at all. Isn't it the purpose of the custom descriptor interface to return property descriptors for a class. But that's just my surface observation. Anyways the real power of this platform definetly lies in partial trust scenerios and of course if you have any future plans for a silverlight version then this will definetly be an issue to address. Thanks, Kavan |
|
|
I don't think we'll need to ship a satellite assembly, but we are still considering exactly how to address the partial trust scenario. The reason for subclassing PropertyInfo is that some things are representable only as PropertyInfo and some only as PropertyDescriptor. In order to provide a transparent API (and internal model), we either had to wrap PropertyDescriptor-only bits in PropertyInfos, or PropertyInfo-only bits in PropertyDescriptors. Our initial scenarios led us to a PropertyInfo-based model, so when we added custom descriptor support we took the former approach. Switching over to the second approach is one of our possible approaches to the partial trust scenario but we need to do so in a way that doesn't break the existing API. Anyway, we appreciate your feedback on the importance of partial trust support and I hope we will have something for you reasonably soon. |
|
|
Okay, experimental partial trust support is in the next nightly build (20080208 at http://www.mindscape.co.nz/Products/WpfPropertyGrid/nightlybuilds.aspx -- should appear in the next 12-18 hours). Please give the tyres a bit of a kicking, but do understand that it has not been exhaustively or systematically tested in the partial trust environment. Note that you will need to increase the permissions of your XBAP from the normal Internet or LocalIntranet settings. At the moment you will need to grant: - ReflectionPermission: unrestricted - RegistryPermission: unrestricted - SecurityPermission: enable assembly execution (strangely enough) The grid itself doesn't require anything more than these, and we will clean up the reflection and registry permissions at some point (we didn't want to spend time optimising the permission set until we had something working). Note that any code which refers to Node.PropertyInfo will still fail in partial trust; this can usually be fixed by changing it to refer to the new Node.Property member. (Working, i.e. full-trust, code that refers to Node.PropertyInfo will still work.) Please try it out and let me know how if you encounter any issues. |
|