WPF Commands and Events with MVVM

I have been doing some revision on my WPF, particularly around ModelView-View-Model pattern. One thing that I’ve always found a bit difficult to get right is the handling of events on the window and getting them back to the view model.

I personally believe that the goal of a completely empty code behind should be a best efforts approach rather than mandatory, sometime there is a need for purely UI related code and this, in my view is the correct place.

I wanted to trigger a command when a key was pressed in a TextBox on my Window, in the past I’ve used the PreviewKeyDown and had a handler in the code-behind which has invoked the command on the ViewModel; this has never seemed correct or particularly satisfying. In my current play project I decided to find a better way to achieve this and I think I have - InputBindings.

... read more

Focus on content on page load

One of the requirements for a piece of SharePoint/Office 365 work I’m working on at the moment is for easy finger usage when accessing with an iPad. The user base coming in on iPad are performing a specific task so a lot of the navigation and quick launch is not really applicable to them.

I have been looking at the best way to achieve this and found that calling the existing Javascript function is going to do fine for this need.

\$(document).ready(function () {
SetFullScreenMode(true); // or false to close full-screen

There was another option to set the css when the page loaded but this approach is cleaner

read more

SharePoint and Office 365

Since starting to use Azure more and more I’ve found myself revisiting suddenly enthused by the web and cloud. I’ve had the obligatory Amazon free tier but done little with it. (I’ve recently talked with Amazon about a project at work where I learned quite a lot about glacier and spot instance pricing and it sounds great - I’ll write a post about that shortly).

I’m working on a project doing some initial SharePoint customisation for a customer with an Office 365 account for the company. It’s been a little while since I did SharePoint and I have needed to refresh myself on what is available out of the box, what the development model is like for 365 and how to actually deploy… I’m at early stages but I’m very impressed.

I have always been a fan of SharePoint, often defending its virtues to collegues who generally don’t understand what... read more

Creating pet projects and the Constant Reminder

Now I’ve got into the Azure platform I’ve decided to start making the most of the MSDN voucher I get for free credits. , I am a serial “new project” creator, some of these projects make it as far as being interesting to look at and some don’t. Rather than hosting them on a hugely underutilised and time/effort intensive 1&1 VPS, I’ve decided to host them under Azure. This is not least because I can deploy pretty much anything I would want to without the overhead of configuring it.

So, to start with… there is constant reminder…

Constant Reminder


Constant reminder is a Chrome only web application to leverage the notification functionality provided in the Chrome browser.

Once notifications have been activated using the link at the top of the page, you can create time specific or interval based reminders. For example Drink some water every... read more

New blog, new platform

An interesting chain of events happened last week; @thecodejunkie relaunched his blog, I happen to follow his twitter feed and he happened to mention it.

The chain continued, I followed the link to his blog for a look and read the post there, I am back and this time I am taking control, the content struck a chord about claiming back a blog.

My interest was further piqued by my new found use of Azure and the static generation method discussed in the article.

I forked Sandra.Snow on github and plugged away deploying the sample solution and asking questions till I got it working… thanks to @PhillipHaydon for quickly helping me out.

Interestingly enough, the thing I’ve found most enjoyable about the whole process is learning about Markdown… Other than the odd stackoverflow post, I had not had any use for it. Now, I’m sitting on... read more