c# - WPF ProgressBar doesn't update? -
i trying update progressbar using data bindings. xaml file contains progressbar:
<progressbar height="23" name="progressbar" verticalalignment="bottom" margin="207,444,0,0" minimum="0" maximum="{binding progressbarmax}" value="{binding progressbarvalue}" /> my relevant c# class contains getter & setter:
private int progressbarmax; public int progressbarmax { { if (this.progressbarmax == 0) this.progressbarmax = 1; return this.progressbarmax; } set { this.progressbarmax = value; } } private int progressbarvalue; public int progressbarvalue { { return progressbarvalue; } set { progressbarvalue = value; } } in "update" method maximum being set. example this.progressbarmax = 100;. in loop progressbar value getting value += 1. see updates used application.doevents(), later implement threads. data binding has correct, because have other components work fine.
so why doesn't progressbar update?
thank help.
you need implement way let progressbar notified whenever progressbarvalue changes. have @ inotifypropertychanged interface.
Comments
Post a Comment