Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a progress bar to the background of a WPF control

How can I modify certain WPF controls (i.e. combobox, textbox, etc) to have a progressbar in the background of the control (which I can enable and disable on demand). I don't need it to actually show an accurate progress, rather I just need an indication that this control is waiting for something to finish. A spinning icon inside the control would be OK too.

I have seem some answers that deal with having one control on top of another and setting transparency, etc, but I would greatly prefer to find a better solution.

Thanks!

like image 806
user981225 Avatar asked Dec 02 '11 17:12

user981225


1 Answers

You can put anything anywhere, you just need to modify the respective Template, which may not be trivial, you could start by copying the existing ones.

To enable and disable easily you maybe should subclass the control you target so you can have a dedicated dependency property for that which can be bound to the Visibility of the ProgressBar in the template (perhaps with a BooleanToVisibilityConverter).

like image 188
H.B. Avatar answered Sep 22 '22 19:09

H.B.