EphiBL
Topic Author
Posts: 2
Joined: 24 Sep 2023, 04:48

Collection<T> and ObservableCollection<T> not found?

11 Dec 2023, 23:18

Hiyooo,

I can't get access to Noesis.ObservableCollection<T> or Noesis.Collection<T> in my Unity scripts.

The namespace is definitely accessible as I can access many basic things such as Noesis.Brush etc, but these two are suspiciously missing for myself and all my team members!

We're a little stumped! We can access the System.Collections.ObjectModel version but not the Noesis version, when using the System.Collections.ObjectModel version, we're still able to successfully bind but the bound values do not update in either direction.

Are we missing something silly?

Noesis Version: 3.2.2
Unity Editor Version: 2022.3.14f1

EDIT: I've just looked through the questlog sample and seen that that uses the System.Collections.ObjectModel version as well, perhaps our issue lies elsewhere...
 
User avatar
sfernandez
Site Admin
Posts: 2997
Joined: 22 Dec 2011, 19:20

Re: Collection<T> and ObservableCollection<T> not found?

14 Dec 2023, 10:19

Hello,

Both Collection<T> and ObservableCollection<T> are .NET types available in System.Collections.ObjectModel namespace, you should use those. There are no Noesis versions exposed in C#.

If you need your collection to automatically notify when it changes (add, remove items), then you have to use an ObservableCollection in your viewmodel.
If your notification problem is with the properties of the item itself, then make sure that item type implements the INotifyPropertyChanged interface and that you are raising PropertyChanged event when a property changes, as we do in our samples: https://github.com/Noesis/Tutorials/blo ... del.cs#L19

Who is online

Users browsing this forum: No registered users and 4 guests