i searched a lot about this but can't find a solution for my exact case:
First, i'm doing a little download manager, i list all my downloads in a listview element.
My Listview (named downloadListXaml
) have some GridViewColumn binded to a my element (stuff like file name, file size, and a progress bar).
Every download is managed by a separate thread, every thread just update the progress value binded to my ProgressBar.
In my initial project every thread refreshed the UI on every change to Progress but this make the entire UI freeze sometime. So i maked a separate thread that refresh my Listview every 100ms and ONLY if some download thread are active, here the simple code used for refresh:
downloadListXaml.Items.Refresh();
This works and UI is always responsive, but the progress bar animation just jumps every 100ms to the next value, not good looking at all.
I want to smootly refresh it, and i found some solution, like this: How to update a progress bar so it increases smoothly?
The problem in that solution is that i need to refeer to my ProgressBar xaml element, but i just can access to my object binded to the ProgressBar.
So, i think my only solution is solve this XAML-Side, attaching an animation to the ValueChanged
event of the ProgressBar.
I'm really new to XAML and i'm not even sure i can do this. Is this possible? How can i do it?
TL;DR version: i don't know how to animate a ProgressBar value change working only in XAML when ProgressBar value is binded to a code-side managed object.
Refresh()
in the UI element. Just update the progress property value and call NotifyPropertyChange(). - Federico Berasategui