Microsoft Surface – Restoring unit to initial factory state

April 6, 2009

Last week I needed to completely reset my surface unit back to factory settings due to erratic behavior (mostly in VS 2008).  I followed the docs on the process Microsoft released in their SDK, but I had a couple of hiccups I thought I would share with you.

1.  When you restart your surface you will want to hit your delete key once a second when the bios screen appears.  Then when that screen changes you will want to hit F8.  For some reason I had difficulty timing these key strokes.

2.  you will need to switch from the X: drive to the C: drive to run the recovery.cmd command.  Believe it or not, I tried cd C:\ to switch drives.  I haven’t needed to switch drives in a long time in a command window.  The proper way to switch drives is to type in just C:\ without the cd part.  How embarrassing.

3.  I know some threads on the Surface forum suggest that you might need a “secret” password to do this (maybe I misread them), however I found out from Josh (Surface guy at Microsoft who really knows his stuff) that this password is only needed for more advanced bios stuff.  He didn’t detail what that was exactly, but restoring my surface unit wasn’t one of them.

Other than these hiccups the restore went quite smooth and relatively quickly if you follow the docs Microsoft provides.


Microsoft Surface – Turning WPF controls into Surface controls

March 24, 2009

When I first started learning Surface I quickly realized how to turn a WPF app into a surface app.  Basically, I did a search and replace for each control in the WPF app that has a matching control in Surface such as Button and TextBox.  By doing simple replacements I was able to get a surface app up and running quickly.  However, I recently learned a way to really extend this method.

All you need to do is edit the control template for the particular WPF control (that doesn’t have a surface twin) and in the template convert all instances of Button into s:SurfaceButton, all instances of Slider into s:SurfaceSlider, and the Thumb into s:SurfaceThumb, etc..  Just make sure you change both the controls themselves, as well as the control styles (for instance, if the first control in the template is a <Button> and it has a <Button.Style>, so change this to <s:SurfaceButton> and <s:SurfaceButton.Style>).

See my previous blog post for a way to get at the entire default control template for editing.

Microsoft Surface – Customizing the look and feel of the ScatterViewItem (and other controls)

March 23, 2009

The ScatterViewItem is a very useful way to get the “surface feel” into your apps very quickly. However it is likely you will want to customize how your ScatterViewItem looks and reacts to user input. The following steps will help you customize it to your hearts content. This procedure could be applied generally to any other control as well.

1. Create a WPF application in Visual Studio, add a ScatterView and ScatterViewItem. Save the project.
2. Open project in Expression Blend.
3. Under Objects and Timeline, right click on the ScatterViewItem control, select Edit Control Parts (Template) -> Edit a Copy…
4. Give it a new name like ‘ScatterViewItem_Customized’ and click OK.
5. Save the project and return to VS. VS will prompt you to reload changed files.
6. Now you will have the entire default control template to modify to your hearts content.