Feldruebe
Topic Author
Posts: 20
Joined: 24 Jun 2018, 11:52

Indexer binding not updated

11 Nov 2023, 00:28

Hello,

I have a binding on a List using an indexer.
Something like this:
Property
public List<Test> MyList
{
	get => this.myList;
        set => this.SetField(ref this.myList, value);
}
Binding
<TextBlock Text="{Binding MyList[0].Text, ElementName=Root}"></TextBlock>
Now I want to update the element. In my case setting the first element to null.
this.MyList[0] = null;
this.OnPropertyChanged(nameof(this.MyList));
In Unity this does not update the binding. I WPF this does work. Is this a Bug or is it unsupported, did not find anything in the docs?
 
Feldruebe
Topic Author
Posts: 20
Joined: 24 Jun 2018, 11:52

Re: Indexer binding not updated

11 Nov 2023, 01:00

Nevermind was a mistake by me. It works.

Who is online

Users browsing this forum: Google [Bot], Polymorph and 4 guests