C
C#2y ago
POQDavid

❔ Having trouble with binding Dictionary<TKey, TValue>

I am trying to bind Dictionary<TKey, TValue> to my UI and I want it to update like a ObservableCollection<T> but when when I try to do that the list just flashes during update and doesn't look anything like how ObservableCollection<T> updates is there anyway to fix this and make it work like ObservableCollection<T>?
7 Replies
Anton
Anton2y ago
ObservableDictionary Class (Microsoft.IdentityServer.Management.Res...
Learn more about the Microsoft.IdentityServer.Management.Resources.ObservableDictionary in the Microsoft.IdentityServer.Management.Resources namespace.
POQDavid
POQDavidOP2y ago
Does this update normally? From what I noticed this requires ADFS and possibly Windows server is it possible to fix my code instead of using those?
Anton
Anton2y ago
yes, probably I just shared an option that I found
POQDavid
POQDavidOP2y ago
oh its ok ty but i do prefer not to add extra libs like ADFS
jalepi
jalepi2y ago
KeyValuePair is a struct. I don't think update triggers that would work. It would be better if you do the opposite, use an ObservableCollection to hold your values, and expose dictionary interface to manipulate values from outside.
POQDavid
POQDavidOP2y ago
it does update but it keep loading the whole list over every time it updates but with ObservableCollection just shows the changes I am using ObservableCollection right now but was trying to get just KeyValuePair working to make things a bit cleaner
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise 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