using System.Windows; namespace ModuleManager; /// /// Interaction logic for MainWindow.xaml /// //Quinn and Reda and Yazan public partial class ProgressBar : Window { //quinn private int currentValue = 0; public ProgressBar(string title,int maxValue) { InitializeComponent(); lab.Content = title; Bar.Maximum = maxValue; Bar.Minimum = 0; } //Quinn public void UpdateProgress(int value) { //force update and enshure ui thread updates Dispatcher.Invoke(() => { currentValue += value; if (currentValue > Bar.Maximum) currentValue = (int)Bar.Maximum; Bar.Value = currentValue; Bar.Dispatcher.Invoke(() => { }, System.Windows.Threading.DispatcherPriority.Render); }); } }