WinRt

WinRT : Simple schedule control

As some of you may know I have been somewhat of a fan boy of WPF. All of a sudden there is this new kid on the block, WinRT and Windows store applications. So far.  I have not ventured into this world, as I think it is early days with WinRT, and I expect it to change a lot. I did however quite like some of the look and feel elements of it, and thought what the heck it can’t hurt to take it for a quick spin. I also just co-authored an article with a fine yanky chap (hey Ian) who contacted me to review his WinRT MVVM framework, called : StyleMVVM which I promised Ian I would look at, and also take for a spin.

Thing is I did not want to start a big WinRT application (I like to write full apps as you tend to learn a lot more that way), without at least trying out WinRT on something smaller. I still fully intend on doing a larger StyleMVVM app, in fact the material presented in the associated article will form part of the larger StyleMVVM demo application that I promised Ian.

The code attached to this demo is pretty simple, but actually is was enough for a WPF guy to try and find out the WinRT way of doing things, and I have to say there certainly were a few weird things that were quite unexpected coming from WPF land. I will talk about these in the body of the article, but we digress, what does the demo app do?

Like I say I wanted to keep things very simple, so I have written a very simple grid based schedule control, that is readonly you can not add items to it by clicking, its all setup via existing code. Ok that data could suck stuff from a database, but there is no way to dynamically add appointments to the schedule using touch, or the mouse at runtime, though that may feature in the fuller StyleMVVM app.

So in summary, the associated article demo code is a simple schedule control that works with touch or the mouse.

You can download the code and get a full blow by blow account of it right here :

 

http://www.codeproject.com/Articles/654374/WinRT-Simple-ScheduleControl

 

Advertisements
Uncategorized

Expression API Cookbook

This blog post is a strange one in a lot of ways, it is more of me pointing out a set of recipes and linking through to a related article. So  what are the recipes, and what will it show you, the reader how to do?

Well I am going to start with a wee story first (don’t worry the point is one  its way). A while back I got this email out the blue from this guy in the states  who was creating a MVVM framework for Windows 8, and I have kept in contact with  this dude (and he really is a dude, if I can convince him to upload an image,  you will see what I mean) and we got talking about his IOC container within his  MVVM framework, which is like MEF for Windows 8.

Looking through Ian’s code, it was immediately obvious to me, than Ian really  (and I do mean really) knew how to use the Expression API within .NET. This namespace has always  intrigued me, so I talked to Ian about the merits of writing a joint  kind of article, where we would effectively come up with some scenarios to solve  using the Expression API.

Ian said he would be more than happy to write the code  to any scenarios I could come up with, if I was happy to do the article writing  side of things. This seemed a very fair way to do it, so we have done just that.

Now you may be asking what is so cool about the Expression API, well one  thing I quite like is that you can literally write entire programs in it, and  another thing that you see time and time again, is creating compiled lambda  expressions that have been built up on the fly, which compile down to a  delegate, so provide uber fast performance when compared to reflection. That is  why the Expresson API can be useful (at least we feel that way).

That is essentially what the associated article is all about, we have a bunch of  scenarios that I came up with (which I hope are good ones) which Ian has coded  up. The examples range from simple property get/set through to some rather  complex examples where we show you how to do things like how to create  If-Then-Else Expressions and compute a HashCode for an object based of its  property values.

Here is a list of the scenarios we will be covering

  • Change tracker
  • Convert
  • Generic object HashCode computation
  • If-Then-Else
  • Property get/set
  • Dynamic where

Want to know more please read the full article over here

http://www.codeproject.com/Articles/651464/Expression-API-Cookbook