WPF – RateBar
Posted by ipwright83 on June 5, 2012
As per my previous post, I have been working on a WPF based progress bar. This is supposed to be similar to the Windows 8 file transfer progress bar, I’ve named it a ‘RateBar’ as it seems appropriate. Well I’ve finished the initial version of this project and based on the popularity of the question on StackOverflow I imagine there are some other people who would benefit from the control.
I’ve not got any automated tests for it (I’ll try to add some at some point) and I don’t know if it works with WPF styles (mainly because I don’t know how they work), but it all seems to work so far and matches quite nicely based on my initial intention. To get a true windows 8 style it’ll probably need combining with an ‘expansion’ arrow which switches between a progress bar and a rate bar.
Some basic instructions to get you started. You’ll need to do the following (I hope most of which are fairly obvious):
- Add a reference to RateBar.dll within your WPF project.
- Add the RateBar namespace within your WPF window/control that you wish to include it on:
xmlns:my="clr-namespace:RateBar;assembly=RateBar"
- Add an instance of the RateGraph, recommended size is 380×88:
<my:RateGraph x:Name="rateGraph1" Height="88" Width="380" />
- Update Value (the progress), Rate (the current rate) and Caption (the rate info above the black line) on a regular basis.
