❔ update observeral collection into ui
i got a question since i got this code
i want that it sort the blocks into my ui but the blocks are not updating in my ui but it should update right? because i replace it with other block?
so my question is how could i update a observeral collection list in my ui
13 Replies
could someone help me with this
Can you show your bindings with the ObservableCollection?
atm i'm not sure how to work with binding
or do you mean like Get; set;
but i have it now like this
and this is my xaml
@alixd91 So you're not binding to the collection?
Yeah I don't see any binding in the XAML
should i be something like this then?]
because i need to add the children.add
like this but when i do it like this
it doesn't work
So
blocksCollection
is a collection of TextBlock
?
I think you're misunderstanding how ObservableCollection works, observable collection only works when a control is bound to itso iwhat i just want is that the blocks that are in my observeral collection i want to update in my gui since i update it in my collection but not in my gui
You can bind
ItemsControl
to the collection and in the template generate the blocks
The collection would be of brushesthere is also a way to send the updates of the observeral collection to the ui right without using binding?
to just push the new updates to it
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.