❔ WPF - Binding to last child of collection
I have the following setup:
I'm trying to output
LastMessage
in a StatusBar control.
I am following the solution 2 in: https://stackoverflow.com/a/38076864/2275217
However, the StatusBar does not update with new messages. A comment on SO says:
"In case of the property one would want to fire change notifications for said property in case of CollectionChanged
."
However, this is not quite clear to me. What is meant by that? I am using CommunityToolkit.Mvvm for the Observable Object structure, but it wouldn't let me set [ObservableProperty]
on LastMessage
because it's a field.
How to update LastMessage
along with the collection?Stack Overflow
Binding to last array element
So far, i have an ObservableCollection<T> for objects.
I always want to display the last inserted element into a TextBlock. I implemented two solutions in XAML, but both not working:
<
1 Reply
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.