How to copy ObservableCollection?
I have a function as so
And want to copy those ptrs out to another collection so the collection itself can be modified without affecting the original collection. In C# it was the following
But I can't seem to get a copy step going in Noesis that isn't just pointing back at the same collection, and the copy constructor is deleted.
E.g.
Any ideas?
Thanks.
Code: Select all
Noesis::ObservableCollection<FleetNodeEntityViewModel>* GetChildren() const;
Code: Select all
ChildrenToDisplay = new ObservableCollection<FleetNodeEntityViewModel>(selectedNode_.Children);
E.g.
Code: Select all
Noesis::Ptr<Noesis::ObservableCollection<FleetNodeEntityViewModel>> childrenToDisplay_
// ...
childrenToDisplay_ = Noesis::MakePtr<Noesis::ObservableCollection<FleetNodeEntityViewModel>>(selectedNode_->GetChildren());
// or
childrenToDisplay_ = Noesis::Ptr<Noesis::ObservableCollection<FleetNodeEntityViewModel>>(selectedNode_->GetChildren());
// or
Thanks.
-
sfernandez
Site Admin
- Posts: 3093
- Joined:
Re: How to copy ObservableCollection?
Hi, there is no helper method to copy from other collection, could you please report that in our bugtracker?
In the meantime I've seen that C# is just adding each item individually from the source collection, so you can do something similar.
In the meantime I've seen that C# is just adding each item individually from the source collection, so you can do something similar.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests