Dynamic ages in About Me page

Standard

Recently my brother asked me if my daughters’ ages in my About Me page were static or if they would change as we moved through time.  The answer is that they’re the result of PHP functions and are therefore dynamic and will change as time passes.

You see, my site allows me to embed PHP code.  In a nutshell, PHP allows me to create HTML dynamically.  I wrote a PHP function that calculates the number of years/months (or months/days in certain situations) since a given birthdate.  I added this function to my site’s custom functions.php file, and registered it with the WordPress framework so that I can access it with a shortcode. Because I want to be able to use this function multiple times with various birthdates, I wrote it to accept an argument called “birthdate”. In my About Me page, anytime I want somebody’s age, I simply insert:

Continue reading

Configuring the Extended WPF Toolkit’s ColorPicker color palette

Standard

I was in need of a WPF color picker control and settled on the Extended WPF Toolkit.  Note that I didn’t say that I settled for – simply put, the controls in this collection are amazing for the price.

Continue reading

C# default text for WPF textbox

Standard

I’m working on a project developing an application for a touch-screen interface.  As such, all of my screen elements are BIG, to accommodate navigation via touch.  It occurred to me that I could save space by eliminating labels for textboxes.  Of course, I don’t really want to have a bunch of textboxes with no way of knowing which textbox is for which bit of data.  I wanted a way to have the textbox display default text when it’s empty, but to allow for otherwise normal input.  I chose to implement both the OnTextChanged and PreviewTextInput methods to accommodate this functionality.

Continue reading