Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
EnumerableObjectWrapper
posted

I've bound the XamDataGrid to basically a couple levels deep nested of Dictionary<string, customobject>'s, and it is trying to use an EnumerableObjectWrapper on these to display them. However, these objects sub class the dictionary, and provide other properties that I can not get access to using BindingPaths because the enumerableobjectwrapper doesn't keep the complex information of the items it's wrapping. Is there some better way to do this? I would include code but I think it is horrendously obvious what I'm talking about.

I of course could simply not subclass the collections and simply expose an Items or similar property, but I was thinking there was some other way of using intelligent objects that subclass collection classes.

  • 235
    Suggested Answer
    Offline posted

    public mycomplexdictionary : Dictionary<string, anothercustomobject>

    {

              //extra properties here

             public int asdf { get;set;}

    }

     

    I couldn't access the asdf property because mycomplexdictionary was being changed into an EnumerableObjectWrapper, which didn't have my asdf property, although it did have the same items.

    I have since fixed this issue by avoiding subclassing dictionaries and observable collections generally.

  • 27093
    posted

    Hello,

     

    Excuse me for the late reply. I have been looking through your description and since the XanDataGrid does not support direct Dictionary binding I can say that exposing the needed properties and/or crating a wrapper class to do that is the approach I would chose.

     

    Hope this help. Please let me know if I can be of any further assistance .