Notify Property Change for an Indexer
Hi all,
I have an indexer which I am successfully binding to, however I am unable to raise a PropertyChangeEvent as I do not know the indexer's property. The suggestions on WPF documentation is "Item[]", and while this doesn't raise an error (I think because the property Item is automatically created for indexers) it doesn't update the binding.
How do I notify of an indexer property change?
Thanks,
Mark
I have an indexer which I am successfully binding to, however I am unable to raise a PropertyChangeEvent as I do not know the indexer's property. The suggestions on WPF documentation is "Item[]", and while this doesn't raise an error (I think because the property Item is automatically created for indexers) it doesn't update the binding.
How do I notify of an indexer property change?
Thanks,
Mark
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Notify Property Change for an Indexer
Unfortunately it seems to be a bug, indexer properties are not responding to "Item[]" property changes, only IList collections are doing so right now
Could you please create a ticket in our bugtracker, we will try to solve it as soon as possible.
Could you please create a ticket in our bugtracker, we will try to solve it as soon as possible.
Re: Notify Property Change for an Indexer
Will do.
That leaves me in a bad place right now, is the only option I have to create a property for each entry I want to access?
That leaves me in a bad place right now, is the only option I have to create a property for each entry I want to access?
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Notify Property Change for an Indexer
Which kind of keys are you using to access the indexer properties?
If they are ints you can use an ObservableCollection<T>, and if they are strings you can use a ResourceDictionary.
If they are ints you can use an ObservableCollection<T>, and if they are strings you can use a ResourceDictionary.
Re: Notify Property Change for an Indexer
When I use the indexer, the indexer tries to get the required data using an Id. This data can come over the network, so it cannot be stored in an ObservableCollection or ResourceDictionary, at least not without a lot of questionable coding practices. Unless I am missing something?Which kind of keys are you using to access the indexer properties?
If they are ints you can use an ObservableCollection<T>, and if they are strings you can use a ResourceDictionary.
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Notify Property Change for an Indexer
Ok, I understand now, if you cannot store the data coming from the network, ResourceDictionary won't be a solution, you are right.
Anyway, we are going to release soon a patch for the last version with the indexer notification issue solved
Anyway, we are going to release soon a patch for the last version with the indexer notification issue solved
Re: Notify Property Change for an Indexer
I have written a bunch of properties to get around the issue for now, which is a lot of duplication really. I am looking forward to having the indexers working.
Thanks for the quick turnaround on the fix.
Thanks for the quick turnaround on the fix.
Re: Notify Property Change for an Indexer
Solved in 1.2.5f8 released
Re: Notify Property Change for an Indexer
Ha, I was already wondering whether this was a bug when I tried to use indexer the other week. But I couldn't be bothered and went a different route. But it's good to know it's solved now.
Who is online
Users browsing this forum: Ahrefs [Bot] and 54 guests