«
»


Breathing exercise timer for Windows, with .NET 3.5, WPF and Visual Studio C# Express 2008

Posted by jimblackler on Dec 2, 2007

A family member requested I write them a simple windows program to help them with some medically-prescribed breathing exercises. For the exercise (which is designed to lower blood pressure) you have to breath in for six seconds, and out again for six seconds. In the absence of a commercial timer available to do this, a dedicated timer program on PC is the next best thing. The program simply displays a bar-chart type graphic with the bars appearing and disappearing to indicate the six second intervals.

Screenshot

A tiny project like this was the perfect opportunity to take the newly-released VS C# Express 2008 for a spin. Initial impressions are good, just like Express 2005 almost everything is there for professional development. It offers both Windows Forms and WPF as options on the New Project wizard, but it seems only to offer 3.5. In other words there seems no easy way of targeting 2.0 or other .NET versions from the wizard. I can confirm that 2.0 projects do load though (after running the conversion wizard) so it must be possible.

I like the WPF designer and the massive flexibility that WPF gives the developer in UI development. For this application, it was possible to add geometric shapes to the interface, which would have been hard in the Windows Forms designer. Also it meant that the window can be set to scale when resized. Being able to switch between a massive timer display and a tiny one could be very useful for users of a program like that.

For reference, the way to have WPF content automatically scale is to wrap the content in a tag. Note that for me, this meant the designer no longer shows the embedded content which is annoying. But it does mean it automatically scales nicely at run time.

Installer for One to Six program

1 Comment »

hi Jim,
I tried to PM you directly but can’t find it easily.
I hope London and Google are treating you well.
re:
Breathing exercise timer for Windows, with .NET 3.5, WPF and Visual Studio C# Express 2008

Would you mind posting (or sending directly) the C# source as I need to do a weight training rest-period timer and this would be a fantastic leg-up with the bonus of not just a beep but a visual countdown.

THanks for any help
Craig (Oxfordshire, x-London software contrator)

January 29th, 2012 | 5:02 pm
Leave a Reply

Comment