We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TreeMap Items do not update when binding source data changes

Hi,

As mentioned in previous posts I'm moving our WinRT app to Xamarin forms.  I'm having lots of issues with TreeMap.  The scenario is we are using PRISM for XF to help out with MVVM.  I've created a bindable observablecollection of TreeMapItems like this:

        ObservableCollection<TreeMapItem> _MyData = default(ObservableCollection<TreeMapItem>);
        public ObservableCollection<TreeMapItem> MyData { get { return _MyData; } set { SetProperty(ref _MyData, value); } }



If I initialize MyData in the viewmodel constructor like this:
MyData = new ObservableCollection<TreeMapItem>() { new TreeMapItem() { Label="test", Weight=5, ColorWeight=5 } };

I will get items showing up on the TreeMap control.  So I know the Binding between the View and the ViewModel is working and that the TreeMap is visible and capable of rendering data.  But that's of very limited use since we change what the TreeMap show depending on which user's data the current page is showing.   


We load that user data in Prism's OnNavigatedTo event handler, though I've tested by firing another event after that page finishes loading without using PRISM.  The end result is that no matter what I do the TreeMap is never updated regardless of how MyData is populated. We have seen issues with other custom controls where doing an .Add to an observablecollection doesn't update the control (or I guess in Xamarin terms the "view").  The normal workaround for that is to create a separate temporary ObservableCollection, fill it with data, and then assign the temp collection to the real one and call OnPropertyChanged("MyData").  This also doesn't work.

I've even tried creating a separate class with a BindableProperty like in the example and used that (which we shouldn't have to create our own BindableProperty objects unless we are writing an extension) and it wouldn't update once the TreeMap was rendered either.

What is the proper way to update the Items from a ViewModel when using MVVM or is there an issue with the Item's property like we found in the SfChart?

This one is critical and will prevent us from launching on other platforms, so any help is greatly appreciated.

Thank you all for the amazing support you provide.

12 Replies

MV Mohana V Syncfusion Team November 30, 2015 11:57 AM UTC

Hi Jeff,

Thanks for using Syncfusion products.

Currently, we are validating your query by creating the sample with your scenario and we will update you the complete details in one business day(December 1, 2015).

Regards,
Mohana V


JD Jeff Dalby December 2, 2015 10:40 PM UTC

Any update on this?


MM Mageshyadav M Syncfusion Team December 3, 2015 10:28 PM UTC

Hi Jeff,

Sorry for the inconvenience caused.

We have not yet completed the requested sample on binding of TreeMap items in Xamarin Forms as per your requirement and we will update you the possible solution on or before December 7th 2015.

Regards,
Mageshyadav.M


DR Dhanasekar R Syncfusion Team December 7, 2015 12:20 PM UTC

Hi Jeff,
Thanks for your patience.
Query 1: " TreeMap Items do not update when binding source data changes".
We are able to reproduce the reported issue and we have logged an issue report for this. The fix for this issue will be available in our Essential Studio volume 4 2015 release.
Query 2: "What is the proper way to update the Items from a ViewModel when using MVVM"
There is a workaround to update the treemap items. Whenever you are updating or adding data in view model, you can call Refresh method which helps to re render the treemap items.
treemap.Refresh();
Please get back us if given solution does not work.
Regards,
Dhanasekar




JD Jeff Dalby December 7, 2015 04:20 PM UTC

Thanks, since I'm updating from the viewmodel I'll have to fire off an event that the view can subscribe to for the refresh call, but that should get us by for now.   When's the target ship date for Essential Studio Volume 4 2015?  

Jeff


JD Jeff Dalby replied to Jeff Dalby December 7, 2015 05:15 PM UTC

Thanks, since I'm updating from the viewmodel I'll have to fire off an event that the view can subscribe to for the refresh call, but that should get us by for now.   When's the target ship date for Essential Studio Volume 4 2015?  

Jeff

OK so calling refresh after updating the list isn't doing anything either, I've verified that I'm calling Refresh after the ObservableCollection of treemap items has been updated, but no luck.

Jeff


MV Mohana V Syncfusion Team December 8, 2015 12:02 PM UTC

Hi Jeff,

Query: "When's the target ship date for Essential Studio Volume 4 2015? "

We would like to inform you that our Essential studio volume 4 2015 build will be expected to be released on end of December 2015.

Regards,
Mohana V


JD Jeff Dalby January 14, 2016 04:54 PM UTC

Did this fix make it into 2015 Volume 4?  I don't see anything in the release notes (http://help.syncfusion.com/xamarin/release-notes/xamarin-android/v13.4.0.53) for any treemap fixes or updates.


JD Jeff Dalby January 14, 2016 06:39 PM UTC

OK, I've got the new stuff installed and it is definitely not fixed.  I've spent a bit of time trying to figure out any kind of workaround, but it seems nothing will let the TreeMap redraw once the page has been displayed.  I've even created a test button which fires an event that sets the TreeMap.Items to completely new test data and then calls TreeMap.Refresh and that won't update what displayed.  This tells me it's nothing to do with the Binding (which if you'll remember works as long as the data is there prior to the page displaying.) 

It appears something is severely wrong with TreeMap's ability to be refreshed by any means.  This is a huge problem, since it's a key piece of functionality and one of the main reasons we decided to try Syncfusion.  This is made worse because I reported the error six weeks ago, and was told the fix would be in this release (which at that point was 4 weeks away). Instead of using that six weeks to find an alternative solution, I waited based on the fact that you all said you'd fix it and never updated this to say that wasn't going to be the case.

Now I'm weeks past our target ship date, and still don't have a solution.  Please let me know if this can be fixed or a workaround provided very quickly or if I need to find an alternate solution.

Thank you.


NS Nitish Subramania Reddiar Syncfusion Team January 18, 2016 06:58 AM UTC

Hi Jeff,

Sorry for the inconvenience caused.

We would like to provide a custom DLL which includes the fix for your reported issue. We will will update you the DLL with sample on or before January 20, 2016.

Please let us know in case of any concerns.

Regards,
Nitish S


DR Dhanasekar R Syncfusion Team January 20, 2016 04:07 PM UTC

Hi Jeff,

Sorry for the inconvenience caused.

We have fixed the reported issue and we are facing some problem while taking custom DLL. We will will update you the DLL with sample on 21st January 2016.


Regards,
Dhanasekar


DR Dhanasekar R Syncfusion Team January 21, 2016 01:50 PM UTC

Hi Jeff,

Thanks for your patience.

We have created the latest Xamarin TreeMap control custom assembly in 13.4.0.53 version with binding issue fix and it is available in the below link.

http://www.syncfusion.com/downloads/support/directtrac/general/ze/TreeMapCustomDLL811323979

Replace the custom assembly in following location

lib\pcl
lib\android
lib\ios
lib\ios-unified
lib\winrt
lib\wp8
lib\wp8.1

Please let us know whether the reported issue has been resolved with this provided dlls and if the issue still persist, provide us a sample so that we can work on it and provide you a accurate solution.

The fix for this issue will be included in our Essential Studio 2015 Volume 4 SP1 release which is expected to be released by mid of February 2016.

Regards,
Dhanasekar

Loader.
Live Chat Icon For mobile
Up arrow icon