"Kiosk Mode" in Windows 8.x

This little snippet of code came from a real project I worked on. The customer wanted a touch-screen Kiosk. We had to use Windows 8.1 due to hardware requirements. I was able to make a great WPF UX using touch and make it full screen with no borders, and always on top.

In your <Window> Xaml object set these properties: 

 WindowStyle="None" WindowState="Maximized" Topmost="True" ResizeMode="NoResize"

That only got me so far. That pesky right-swipe charm is always there, and there's seemingly no way to get around it.

Turns out all that charm stuff is in explorer.exe, the Windows Explorer. That's the shell that lets you run all your apps. It contains all the taskbar, and gives you all the swipy gestures, corner hot spots, and all that. All you need to do is kill it. 

Also turns out that if you don't kill it properly it will come back with a vengence. So, I discovered this little trick using a ProcessStartInfo object. I call this in the MainWindow_Loaded event and all is well.

If you ever want to restart Explorer after running this app, you can press Ctrl-Alt-Del, bring up the Task Manager and run explorer from File -> Run new task -> "explorer.exe"

Be careful, and enjoy!

        void KillExplorer()
            // Create a ProcessStartInfo, otherwise Explorer comes back to haunt you.
            ProcessStartInfo TaskKillPSI = new ProcessStartInfo("taskkill", "/F /IM explorer.exe");
            // Don't show a window
            TaskKillPSI.WindowStyle = ProcessWindowStyle.Hidden;
            // Create and start the process, then wait for it to exit.
            Process process = new Process();
            process.StartInfo = TaskKillPSI;




In Defense of Flavor

I am one of those Americans who has had the good fortune to be able to travel all over the world. The first time I was in Europe and happened to order a sandwich at an airport shop I noticed two things. Firstly, the bread was a fresh baguette, not an afterthought. It was most likely made that morning by hand. Secondly, what was between the bread didn't look like enough. One slice of meat, a slice of cheese and maybe some tomato. Still, I ordered what looked good and was surprised at how amazingly flavorful it was.

Go to any American chain restaurant and order a sandwich. It comes on bread, but the bread is not considered important. Otherwise, why would it occasionally be stale? Usually restaurant bread is whatever they can get at the cheapest price. The sandwich filling is quite a bit more substantial, but not particularly flavorful. 

We in the States tend to think that salt and fat equals flavor. At least the people who are selling us our food seem to think that's all it takes.

I just went to a local cheese shop and came home with a fresh long baguette, rosemary olive oil, a roasted red pepper, some Serrano ham sliced paper thin, and an assortment of cheese, my favorites being smoked bleu and 7-year Quebec Cheddar. 

Slicing the bread on a bias about 1/2 inch thick, I ended up with a couple 5 inch slices. I brushed each side with olive oil, sprinkled on kosher salt and laid down a single slice of ham, a thin slice of Cheddar, and a bit of roasted red pepper. It didn't look like much, but BAM! What flavor!

I live by the rule that any kind of sauce should be reduced and reduced and reduced more until it's naturally thick. Start with a little chicken or vegetable stock, add herbs, butter, a little soy sauce, some wine, meat drippings if possible, and reduce it down to a thick sauce. You can pour right over your main dish or use it as a sandwich spread. Big flavor.

So, when cooking and shopping, opt for more flavorful food as opposed to mass quantities of less flavorful. Your mouth will thank you, and so will those you cook for. :)



GesturePak v2.0 Public Beta

GesturePak is both an app that records you making gestures and an SDK for WPF (.NET 4.5) that determines when user has made those gestures.  It requires the Kinect for Windows v2 Sensor or the XBox One Kinect Sensor with the optional Kinect Adapter for Windows ($49 US). It also requires the Kinect for Windows 2.0 SDK.

An all new User Interface makes it easy to record and edit gestures.

Download the beta code here



Introducing KinectTools v2.0 for Kinect for Windows v2.0


Tools for simplifying Kinect for Windows v2.0 programming in WPF

KinectTools offers three classes for simplifying the Kinect for Windows v2 SDK.


Exposes a WPF ImageSource property you can bind to an Image control for displaying a 3D Body stick figure. You have control over all of the brushes and pens used to draw the stick figure.

BodyViewer exposes an event that occurs when a frame is available, and passes you a Body object. You can inspect the X, Y, an Z values of each Joint.

You can optionally turn off drawing and just handle the data.

BodyViewer also gives you the ability to draw an image from a PNG file over the head of the body.


Exposes a WPF ImageSource property you can bind to an Image control for displaying full color video.


Exposes two ImageSource properties that you can display in XAML Image controls. Has all of the features of both ColorViewer and BodyViewer except the Body and Color images line up and can be shown in a grid like so:

    <Grid x:Name="MainGrid">
        <!-- Color Video -->
        <Border Background="Black" >
            <Image x:Name="VideoImage" Margin="5" Source="{Binding VideoImageSource}" Stretch="Uniform" />
        <!-- Superimposed Body Video -->
        <Border Background="Transparent"  >
            <Image x:Name="BodyImage" Margin="5" Source="{Binding BodyImageSource}" Stretch="Uniform" />


The ColorViewer may in fact give you a lower frame rate as the ColorAndBodyViewer. That is because the ColorAndBodyViewer does not grab frames the same way as the ColorViewer.

The ColorAndBodyViewer tracks the Body, and hooks the FrameArrived event on the BodyFrameReader, then captures the latest color frame from a ColorFrameReader. The result is 30FPS, even if there are duplicate video frames.


MacBook Pro + Parallels + Windows 8.1 + Visual Studio + Xamarin = awesome

I went searching for the ultimate developer machine setup, and I've found it. The title of this post says it all.

I started with a full blown MacBook Pro. It's got 16GB of RAM, the retina display, and a 1TB PCIeX-based flash drive, supposedly faster than SSD. Basically, I got all the options, and I'm not regretting it. I don't miss the touch screen, either.

At first I thought I should sign in to all of my social services, so I did. That got very annoying very fast. I started by turning off notifications, then I just decided to remove the accounts. This is a developer machine. I use my phone to check Facebook, and the web-based GMail client works just fine for me.

Then, I added Parallels, which lets me run Windows and OSX at the same time. You can either switch full screen or use "Coherence," a mode in which Windows apps can run right alongside Mac apps on the same desktop.

Parallels let me install Windows 8.1 with the option to make it look like Windows 7. This option actually installs the Stardock apps, Start8 (gives you a Windows 7 style start menu) and ModernMix (lets you run Windows Store apps on the desktop). That was a seamless experience that just delighted me to no end.

After figuring out how to navigate Windows with Parallels (switching in and out of Coherence mode) I made sure all the latest updates were installed, and then started installing Windows apps: 

NOTE: In order for you to get the Visual Studio experience you know and love, you must disable the Function Key mapping that the Mac imposes. Go to System Preferences/Keyboard. From the Keyboard Tab, check the box that says Use all F1, F2, etc. keys as standard function keys. Then go to the Shortcuts Tab, Select Mission Control and uncheck Show Desktop (F11) and Show Dashboard (F12). That will give you back your function keys in Visual Studio. :)

On the Mac side I installed the following:

I also had to install the Samsung USB Driver for Mobile Phones so I could connect my Galaxy S5 and use it for development. If you plan on using an Android device, there are instructions on Xamarin's website, but I found this didn't go so far as to explain that you might need to go online to find your phone manufacturer's USB drivers. I had to find that by GoogleBinging it. 

Also, as noted in the documentation, I had to enable USB debugging on my S5. That's tricky. First you have to enable developer mode on the phone by standing on your head and reciting a spell. Then, you have to enable USB debugging. This won't work unless the USB Driver is installed.

After all that I was able to create a new Xamarin Forms app with Visual Studio 2013. I created a Shared project in VS2013. I set the Android project to be the startup project, ran it, and after a few minutes I saw "Hello Forms" on my S5 screen. Great.

The Windows Phone option was easy. It ran in the emulator, which is pretty good.

The iOS app was a bit trickier to set up.

First, you need to run the Xamarin iOS Build Host app on the Mac side, an app which comes with Xamarin Tools, and press the Pair button. 

The Xamarin tools in Visual Studio will look for this app on the same machine. This is the reason why I chose a MacBook Pro with Parallels. It just works.

In Visual Studio you select the iOS emulator, and then you get to select which iOS device you wish to emulate. Set the iOS project as the startup project and run the app.

To summarize, if you want to minimize the cross-platform headaches involved in developing with Xamarin tools, go with a MacBook and Parallels.