❔ ObservableCollection

Hi, I need to update a combobox that is connected in viewmodel layer by an observablecollection everytime that a made a changeon my software and API collect new values. Can't do that, why am i doing wrong?
10 Replies
Google
Google2y ago
Revit stuff? I don't think the ObservableCollection should be private
public ObservableCollection<stuff> Stuffs {get;set;} = new();
public ObservableCollection<stuff> Stuffs {get;set;} = new();
Joao Matias
Joao MatiasOP2y ago
Yeah!! Do you program in Revit API ?
Google
Google2y ago
it's a shame all of the tutorials you'll find are WinForms and all that. most of my side work is related to it, sure.
Joao Matias
Joao MatiasOP2y ago
Ok, but my binding is point to WallEntries that is a public ObservableCollection
Google
Google2y ago
you should use what I shown there You should never re-set the observableCollection, just clear, add/remove to the collection
Joao Matias
Joao MatiasOP2y ago
Understand... need to learn how to do that, new on WPF and MVVM things... And yeah, mos of it are WinForms, and they even never show how to use things like EventHandlers to do modal forms
Google
Google2y ago
Try WPF if you can.
Joao Matias
Joao MatiasOP2y ago
I'm doing that, trying WPF + MVVM architecthure to develop some plugi
Joao Matias
Joao MatiasOP2y ago
It works. But now i wanna to for example, duplicate some wall elements on revit and dinamically update de combobox values. Any clues on how to do this?
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server