WP7: updating a scene

Jan 21, 2011 at 10:20 AM

I'm probably missing something basic: in a WP7 project I have a scene that contains a NodesControl. The NodesControl's ItemsSource is bound to an ObservableCollection.
Everything works fine except the NodesControl is not updated when the collection changes. The binding is updated (I've put a converter and it's called), but the changes are not reflected in the rendered scene.

I've tried updating the NodesControl manually by removing all the nodes and re-adding the ones in the collection (highly impractical as I'm using MVVM), but this does not work: the new nodes are added but the old ones stay there even if they are explicitly removed, so they keep adding up.

It seems to me that this may be done on purpose for performance reasons, but I suppose there is a way to update/reset the whole Game control: could you please tell me how?

Thanks!

Francesco

Coordinator
Jan 23, 2011 at 11:06 AM

Hi,

thanks for reporting this. This is probably just an oversight. You might want to look at the InstancingNodes control instead. Its a bit different, but more optimized than the NodesControl as well. 

 

Coordinator
Jan 23, 2011 at 11:06 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jan 23, 2011 at 12:19 PM

Thanks for the tip, however I cannot find InstancingNodes. Is it possible that it's not part of the WP7 assembly?

Coordinator
Jan 29, 2011 at 11:39 AM

Sorry for late replies - been away all week. 

You're absolutely right - the InstancingNodes was not part of the WP7 solution. Checking this in soon.