March 2009 Blog Posts

WPF Printing Part 1 – Printing Visuals

This is the first part of a series of posts about printing in WPF starting from printing a single element and going all the way to advanced topics like background printing and XPS. We will start this series with absolutely the simplest WPF application that prints something, we will create a window with a single button – and we will then print this button. The gateway into the WPF printing system is the System.Windows.Controls.PrintDialog class, this class manages printer settings and let you do the actual printing, it is also, as the name suggests, the print dialog – but you don’t have...

Getting a WPF application to pick up the correct regional settings

Before we begin, the way a program gets its settings is both complicated and outside the scope of this blog post, when you test functionality related to settings change it’s important you start the program directly from a folder window, if you run it from within Visual Studio or any other program you may get incorrect results. First let’s see the problem - open Visual Studio and create a new “Wpf application” project Change Window1 code to: public partial class Window1 : Window { public Window1() { InitializeComponent(); ...

Licensing Components for a small software company

Important note:  the advice in this post is true for most small software companies, it is not true for large software companies and is especially not true in some specific markets (like computer games) . Being a developer in small software company myself I tend to read forums frequented by developers in small software companies – and it seems every week someone who is about the release the first version of his product asks about licensing components and obfuscators. A “licensing component” is a piece of software that makes sure that only someone who actually paid for the product is using it,...

A way to use triggers anywhere in WPF

The biggest limitation of triggers in WPF is that except for EventTrigger they only work in styles and templates, I always find myself in situation where just putting a trigger directly in my window or control class will save me a lot of work – but it just can’t be done. Just a few days ago I accidently run across a simple workaround, this is probably the best kept secret in WPF and is hidden in a little blue box at the end of this post on animation in M-V-VM. Just define a DataTemplate with whatever you want to show and your...

A Review of yaTimer on becoming-a-writer-seriously.com

I just love to read about yaTimer, especially when it’s such a positive review: http://becoming-a-writer-seriously.com/wordpress/2009/02/28/time-and-motivation-another-timer-to-the-rescue/

Productivity Tip - Urgent Is Not the Same as Important

Some things are both urgent and important, for example paying you taxes on time, getting your product ready or getting a client out of trouble, however, most urgent tasks are not important and most important tasks aren’t that urgent. Improving your products or your profitability is important, but most of the time it’s not urgent, there isn’t any real clear deadline – on the other hand, some clients always have deadlines, making working for them urgent, but often working for them (right know) isn’t that important and there’s better things you can do to improve your business. That is why you should...

The BitsDuJour Promotion is Over

Actually it was over five days ago but it was a very busy week and I haven’t had time to blog about it until now. I would like to thank everyone who bought a yaTimer license, and also everyone who sent me a message, you feedback is very valuable to me. This was a very successful promotion, managed extremely professionally and efficiently by Roger from BitsDuJour, if you own or manage a small software company I highly recommend running a promotion with them – and if you don’t I recommend following the site, there is some really nice software featured there (I...