Handling events from within a ControlTemplate in WPF

Here’s an interesting one that had me stumped for a few hours.

Following on from my previous post, where I explained how to create a ControlTemplate to style a TextBox in WPF, I’ve got an object, TextEntryBox, which dervies from a TextBox (it provides some custom event handlers when text is entered, but to all intents and purposes, it’s a regular TextBox).

I wanted to style my TextEntryBox, this time including a button within my ControlTemplate (this will eventually toggle an on-screen keyboard pop-up, but that’s another blog post!). I came up with this:
Read the rest of this entry »

Tags: , , , , , , , , , , ,

1 Comment


How to create a ControlTemplate for a WPF TextBox

This is a short post, but has one specific piece of information I want to keep.

Q: If you want to create a ControlTemplate to provide a custom style for a TextBox, how do you specify where the text goes when it’s used in WPF?

A: The answer was hidden in the depths of the MSDN Documentation. You have to include a <ScrollViewer> within your ControlTemplate with an x:Name value of “PART_ContentHost”.

Here’s a noddy example:


Tags: , , , , , , , , , ,

No Comments


My New Project!

Happy New Year everyone!

To celebrate 2010 in style, I’m launching a 365 Photography Project.

It’s got it’s own blog and I’ll be posting photos to my flickr stream and to the blog every day so please check it out!

First post…. tomorrow! =) Hang-over or no hang-over…..

Right, let the festivities commence!

Tags: , , ,

No Comments


My First Photobook Online!!!

After a few weeks of fiddling with Blurb’s excellent BookSmart app, I’ve finally finished my first photobook.

The book covers my best shots taken between 2006-2009 and so pretty much plots the development of a serious photography addiction for me, from the early 350D days, right up to the most recent Cornwall trip and Low Light Photography Course I attended last month (yes, blog post LOOONG overdue for that one, it’s on its way. The photos are just hitting my flickr now and over the next few days!)

A collection of my…
By Richard Dutton

Please feel free to drop by and have a look, all of the photos are from my flickr stream but I thought it was about time to have something in print.

Blurb’s software has come on in leaps and bounds since the last time I tried them out a few years ago. With a version for both Mac and Windows users, it provides not only the standard templated layouts, but also the ability to tweak and create your own layouts from scratch, something which I felt was missing from the original version.

I’ve got a printed copy on its way and will report back as soon as it arrives.

Tags: , , , , , ,

No Comments


Mozilla 1 – Microsoft 1

Add-ons may be causing problemsAfter silently installing their own add-ons to Firefox earlier this year as part of a Microsoft Service Pack, it appears that last last week Mozilla finally got around to blocking them on security grounds.

While Microsoft are happy modifying and ‘updating’ other people’s software in one of their updates, they then seem a bit lapse in keeping on top of the ol’ bug fixeroo, one of the primary reasons people flee from IE in the first place.

Prior to Mozilla blocking them, it turns out that this particularly nasty ‘Critical Remote Code Execution’ vulnerability applied not only to IE, but to Firefox installs containing these add-ons. So thanks guys, I’m glad someone’s watching our backs! =)

(Now, who knows what this will do to my WPF XBAP testing? After all that I might have to dust down IE!)

Tags: , , , , , , , , , , , ,

No Comments


Google Wave Preview

Google Wave Preview InvitationGot my Google Wave invite through this morning, guess I need to RTFM and figure out exactly what it is/does as it all seems a little empty at the moment. Probably not helped by the fact that I don’t have any contacts using it either! Hmmm a one-man collaboration tool? About a useful as a chocolate teapot methinks! Got 6 invites left if anyone wants one?

Tags: , ,

2 Comments


Personal Route Logging with MobileMe’s Find My iPhone

Although I’m struggling to achieve a happy co-existence between Google’s Calendars and Contacts and my MobileMe subscription (still fighting dupes and funny syncs with the wrong numbers being associated with the wrong contacts etc… but that’s for another blog post!), one part of MobileMe I was keen to do something with was their “Locate My iPhone” feature. Regular apps aren’t allowed to run in the background on the iPhone, making any form of auto-updating tracking application all a bit “manual”  (e.g. Google Latitude on the iPhone), Apple have provided the ability to get the location of your iPhone automatically, but as it’s officially being touted as a feature to use when you’ve lost your iPhone it’s tucked away within the “Account Settings” section of the MobileMe web page.

This was screaming out to be screen-scraped and Read the rest of this entry »

Tags: , , , , , ,

4 Comments


Wild Arena – Big Cats 2 Workshop and Experience – Review

I meant to blog about this in the week, but last Sunday I visited the Wildlife Heritage Foundation as part of the Wild Arena Big Cats 2 Workshop and Experience which I blogged about a while back. I thought I’d share my experience and show off some of my photos from the day.

Their site in Kent is excellent. It’s only open to the general public through specialist days (photographer, wildlife experiences, etc.), through which they are funded and so it’s a lot more intimate than a zoo. The enclosures are arranged around a central grass car park, ideal as you can keep heavy kit in your car which is never too far away for a quick lens change. Having said that, I managed to spent the entire day shooting with my 70-300 IS USM, despite bringing my entire kit bag and tripod!

As the site takes part in numerous breeding projects for the cats, it’s no surprise that animal welfare is their number one priority and this is reflected in the quality of the enclosures and environments they provide. The obvious advantage for photography is that you can get right up to the enclosures and take pictures through the bars which eliminates the usual problems you get trying to photograph big cats (or any of the more dangerous animals) in zoos, where you are kept back from the enclosure by another fenced off area meaning you can’t keep the bars out of shot.

Read the rest of this entry »

Tags: , , , , , , , , , ,

No Comments


DoshTracker Update #4 – Bye bye Ext JS!

I admit that finding the time to work on DoshTracker has been really difficult lately, but after months of banging my head against a wall, I’ve decided reluctantly to drop the Ext JS framework I was trying to use.

Yes, it’s pretty and yes, it makes some features almost trivial to implement but I’m struggling to find a satisfactory method for implementing any form of user authentication; a critical feature to allow you guys to log in and view your entered notes. The framework is nice, one of the most visually impressive Ajax frameworks I’ve come across but this has been my stumbling block and so I just can’t justify ploughing any more of my already scarce time into it.

So, the way forward… Well from here on in it’s going to be a clean CSS layout more akin to the DT of old but with the google map integration I’ve already developed. Managed to steal away a few hours this weekend to work on a template layout and so work on the back-end plumbing is now underway. Watch this space…

Tags: , , ,

No Comments


All quiet on the blogging front…

I know I’ve been pretty quiet as far as technical blog posts are concerned but I’ve not abandoned this blog, I’ve been working over the last few months entirely on Windows network driver development (NDIS 5.1), something which I profess to having absolutely no prior experience with so there really wasn’t anything relevant to blog about.

I’ve been making notes throughout the whole experience and so plan to post them shortly with the aim of helping anyone else who finds themselves in a similar situation and needs to get up to speed with Windows network driver development (NDIS 5.1). I am by no means an expert but want to share what I’ve learnt so far.

Tags: , , , ,

No Comments



SetPageWidth