How can I efficiently force a UI refresh of individual rows? #82
Answered
by
w-ahmad
AlexanderBlackman
asked this question in
Q&A
-
I have some bulk commands that change all selected rows at once. private void HardRefreshItems() //Very wasteful
{
_dispatcherQueue.TryEnqueue(() =>
{
var items = this.ItemsSource;
var selected = SelectedItems.Cast<TodoItem>().ToList();
this.ItemsSource = null;
this.ItemsSource = items;
_updatingSelection = true;
foreach (var item in selected.Where(i => Items.Contains(i)))
{
this.SelectedItems.Add(item);
}
_updatingSelection = false;
_messenger.Send(message: new TodoSelectionChangedMessage(selected, fromView: true));
});
} |
Beta Was this translation helpful? Give feedback.
Answered by
w-ahmad
Apr 24, 2025
Replies: 1 comment 3 replies
-
@AlexanderBlackman, I'm afraid I couldn't understand the problem that you are facing, could you give some more information about your implementation? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here what I understood.
If you want to update cell values from code behind logic then: if you have implemented
INotifyPropertyChanged
on your models then it is not difficult to update individual items from code behind.it would be very helpful to understand issue if you can upload a full example or working application.