[Python.NET] Re: Help with an ObservableCollection

[email protected] Tue, 09 May 2023 15:52:57 -0000
Newsgroups gmane.comp.python.dotnet
Message-ID <[email protected]>
Hi folks,

I managed to figure this out. What I ended up doing was just creating an observable collection in python and adding the items to that. I couldn't find documentation on how to use generic type classes in pythonnet, so hopefully this helps someone else. Here's how I did it:

import System.Collections.ObjectModel
observable_collection = getattr(System.Collections.ObjectModel, 'ObservableCollection`1')
...
VegetableRecord = observable_collection[VegetableRecord]()
VegetableRecord.Add(newVegetableRecord1)
VegetableRecord.Add(newVegetableRecord2)


All the best.

- Jesse
_______________________________________________
Python.NET mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]