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
110
XamDataTree get unused property of view model of node
posted

Hi

I used Infragestics 14.2 and I find bug in the tree control

I have class like 'NodeViewModel' with two Property 'Text' and Property 'UnusedProperty' and class 'NodeContainerVM' with Property of 'ObservableCollection'.

'NodeContainerVM' is base class of 'NodeViewModel'.

When I bind Collection of NodeViewModel to ItemSource XamDataTree I see Control getting 'UnusedProperty'. In result in some case application freeze for sometime in some case Control get all properties for ALL nodes - virtualization DOES NOT work

I attached example of BUG

Can you help?

Thanks,

Eugene

XamDataTreeBugApp.zip
  • 34430
    Offline posted

    Hello Eugene,

    I have been investigating into this behavior that you are experiencing, and I am able to reproduce this behavior with version 14.2.20142.2283. It appears that there did exist a bug in this version, but was never fixed for that version, likely because the 2014.2 development lifecycle ran out as specific version 2283 was the final version for the Infragistics for WPF 2014.2 product. You can view these product lifecycles here: https://www.infragistics.com/support/product-lifecycle.

    I have tested against our most recent 2016.2 and 2017.1 versions, and this issue is no longer reproducible there, and so if possible, I would recommend upgrading to these versions where this issue has been fixed.

    I have also been looking into a workaround for this issue, and it appears that the root cause has to do with the way that your view-models are structured. Something about the XamDataTree in 14.2 did not like the ItemsSource setting when it comes from an inherited class.

    For example, if you had a structure where you had an ObservableCollection property named Data on an "AlternateViewModel" class, and then had your XamDataTree's data context be a class that derives from AlternateViewModel, and then you tried to bind the ItemsSource to Data, you would see this same effect. Even setting the collection programmatically seems to have the same effect, and so in order to work around this issue in 14.2, I would recommend that you ensure that your ItemsSource property's declaration exists directly on the class that exists as the data context of the XamDataTree, rather than having it be inherited. This appears to resolve the issues you are seeing.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer