Scott Hanselman

IE6 Warning - Stop Living In The Past - Get off of IE6

February 24, '09 Comments [83] Posted in ASP.NET | Musings
Sponsored By

Here's a chart showing ONLY Internet Explorer visits to my blog over the last few weeks:

17.96% of visitors to my site are on IE6

I'm bummed to see that nearly 20% (17.96%, in fact) of my visitors are using IE6. (Interesting that 8% are already using IE8!)

There's a great website that's attempting to deal with this and get folks off of IE6, called It all started like this and spread over Norway like wildfire. Hopefully it'll spread over the rest of the world and we can all add one less browser we need to test against.

There's lots of ways you can add a warning to your website or blog. The EASIEST way would be to add some HTML like this: (modified from examples posted here)

<!--[if lte IE 6]>
<style type="text/css">
#ie6msg{border:3px solid #c33; margin:8px 0; background:#fcc; color:#000;}
#ie6msg h4{margin:8px; padding:0;}
#ie6msg p{margin:8px; padding:0;}
#ie6msg p a.getie7{font-weight:bold; color:#006;}
#ie6msg p a.ie6expl{font-weight:bold; color:#006;}
<div id="ie6msg">
<h4>Did you know that your browser is out of date?</h4>
<p>To get the best possible experience using my website I recommend that you upgrade your browser to a newer version. The current version is <a class="getie7" href="">Internet Explorer 7</a> or <a class="getie7" href="">Internet Explorer 8 (Beta)</a>. The upgrade is free. If you’re using a PC at work you should contact your IT-administrator. Either way, I'd personally like to encourage you to stop using IE6 and try a more secure and Web Standards-friendly browser.</p>
<p>You could also try some other popular browsers like <a class="ie6expl" href="">FireFox</a> or <a class="ie6expl" href="">Opera</a>.</p>

There are many plug-ins for different blog engines posted there as well. However, adding text like this is easy because it uses some built in crazy detection code that is unique to Internet Explorer (and oft-maligned) using HTML comments. Note the first line of the code has this weird thing: <!--[if lte IE 6]> called a conditional comment. This is easy to do, just add the text above to your blog's template. There's no server-side requirement at all.

Just a picture of what you'd see if you were running IE6

If you're using DasBlog for your blog engine, as I am, just add the text above to the top of your hometemplate.blogtemplate file and you're all set.

The downside is that it's roughly 1000 bytes, but it's temporary. Another technique would be to sniff the user's browser on the server side and only emit this text when they are running IE6 or below.

Now, it's your turn!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Fun with Twitter for Mix09

February 19, '09 Comments [6] Posted in Mix
Sponsored By

image One of the conference organizers for Mix09 gave me some free tickets to give away last week. I figured where better than Twitter for such nonsense, so we've been having some fun over there. (Here's how to use Twitter, if you care about the uselessfulness of Microblogging)

*That Twitter Bird is from Kean Hui's collection of 100 Twitter Bird Icons.

Twitter is limited, since you've only got 140 characters to be creative. Here's some of the things the "tweeple" have come up with.

The "#mix09" characters you see in many of the tweets are a hashtag, that folks on Twitter use to create topics/rooms to that folks can follow the conversation using or other Twitter Trending tools like

Warning, what follows are all the tweets in response to my bolded questions. Some are a chuckle, others, not so much. ;) Good fun, though and a silly way to give away tix.

You know it's Bubble 2.0 when...

You know it's Bubble 2.0 when Scott Hanselman asks you if you "Would like fries with that". #mix09

#mix09 You know it's Bubble 2.0 when you don't need a government bailout...yet.

You know it's Bubble 2.0 when TwitPic acquires both Google and Microsoft. #mix09

#mix09 You know it's Bubble 2.0 when your parents want their own "MyFace" page.

You know it's 'Bubble 2.0' when 50% of all tweeple describe themselves as "Entrepreneurs" #mix09 You know it's 'Bubble 2.0' when Steve Ballmer yells 'Tweeple, Tweeple, Tweeple!'. #mix09 You know it's 'Bubble 2.0' when companies begin looking to an online bookstore for their infrastructure needs You know it's 'Bubble 2.0' when @scobleizer becomes the next U.S. president #mix09 You know it's 'Bubble 2.0' when searching for "web 2.0" returns more hits than "Angelina Jolie". #mix09 you know its bubble 2.0 when you can win #mix09 tix for doing haiku in 140 charcacters or less.

#mix09 You know it's 'Bubble 2.0' when you can buy "How to become a social media expert" cds on ebay

#mix09 You know it's 'Bubble 2.0' when URL shrinking web sites start charging per character.

You know it's Bubble 2.0 when you know more "Social Media Experts" than developers. #mix09 You know it's Bubble 2.0 when they announce an app store for the Newton. #mix09

#mix09 You know it's 'Bubble 2.0' when Bubble 1.9 beta's trial period expires.

You know it's 'Bubble 2.0' when everyone calls it 'Bubble 3.0' #mix09 You know it's 'Bubble 2.0' when your heart skips a beat at the mention of Jon Skeet's name #mix09

#mix09 You know it's Bubble 2.0 when you get free tickets to shows for telling jokes!

You know it's 'Bubble 2.0' when Michael Arrington goes on vacation. #mix09

#mix09 You know it's 'Bubble 2.0' when even a brand new Twitter account is valued at $500

#mix09 You know it's 'Bubble 2.0' when even Scott Hanselman has to get a job at Panera

#mix09 You know it's bubble 2.0 when 3 of 4 local news agencies have "twitter guy" icons complete w\capes and creepy leotard

#mix09 You know it's Bubble 2.0 when Microsoft starts bailing out its partners.

You know it's 'Bubble 2.0' when you don't need to live in San Francisco to make it. #mix09 You know it's 'Bubble 2.0' when you can actually charge money for valuable services and don't get directly paid for them #mix09

#mix09 you know it's Bubble 2.0 when CEO's of IT companies take advice from CEO's of investment banks

#mix09 "You know it's 'Bubble 2.0' when even twitter thinks they can make money...

You know it's 'Bubble 2.0' when people are giving away free mix tickets for "You know it's Bubble 2.0 when" jokes #mix09

#mix09 Tweets in the Style of

#mix09 Chuck Norris was written in C# which itself was written in Chuck Norris

During #mix09 excessive tweets have been known to take out both engines on flights out of McCarran airport.

#mix09 can talk about Fight Club.

#mix09 What the Web calls innovation, MIX calls "barely trying"

#MIX09 MVC actually stands for Model-View-ChuckNorris. Controller is just one of his nicknames

#mix09 Chuck Norris says WPF is Will Pound Frequently

#MIX09 You don't follow Chuck Norris on Twitter. He follows you, finds you, and kills you

#MIX09 "Ask The Experts" track was changed to "Ask Chuck Norris" instead. Organizers apologize.

#mix09 List<ScottGu> throws an exception - there is only one ScottGu.

#mix09 Fact: ScottGu doesn't build with MSBuild. MSBuild builds with ScottGu.

#MIX09 ScottGu won his first programming contest when he was 25... seconds.

At #mix09 the Luxor has to borrow power from Silverlight

#mix09 fact: we don't need to put Mix09 on the Internet - the Internet is coming to Mix09

#mix09 Chuck Norris schedules ass-kickings with his Windows Mobile 7 phone through a Bluetooth implant in his brain

#mix09 if MIX09 were a man, he'd 5 Chuck Norrises

#mix09 chuck Norris has been coding on Windows 8 for years.

#mix09 - If MIX09 played Roulette, the house would give 33-to-1 odds in MIX09's favor.

#mix09 - Only MIX09 can prevent Forest Fires.

#mix09 Superman wears Scott Guthrie pajamas at #mix09 Microsoft will demo their newest development platform: Windows SkyNet 2012 R2 The Venetian Hotel will be sporting the Expression Blend "dark theme" becuase of #MIX09

#mix09 Silverlight 3 Beta is not being released, it is merely allowing mortals to see it.

ScottGu finished coding Silverlight 5 last weekend, but since MIX only happens once a year, he can't ship it until 2011

#mix09 invented Al Gore.

#mix09 "ScottGu doesn't wait on a mutex, the mutex waits on ScottGu."

The design of Silverlight DeepZoom was directly inspired by Scott Guthrie's powers of bionic vision.

#MIX09 is the only event that will make Chuck Norris wear a charcoal grey turtleneck.

#mix09 always has 1.21 gigawatts of power.

#mix09 plans to replace Jon Skeet as what powers the world's Google queries

#mix09 Scott Hanselman's entry in the Mix 10K contest was Live Mesh rewritten in 512 bytes.

#mix09 is running multiple sessions on "how to divide by zero" because of the anticipated popularity scott hanselman can divide by zero! #mix09

#mix09 fact: ScottGu's keyboard doesn't have the ESC key because he can never bet trapped!

#mix09 fact: If ScottGu threw a roundhouse kick, he might tear a ligament. :-)

#mix09 can make the Kessel run in under twelve parsecs @shanselman destroyed the periodic table, because he only recognizes the element of surprise. #mix09 Chuck Norris doesn't need to attend #mix09 because he already wrote all the code being presented in '08

#mix09 fact: ScottGu gave last year's Mix presentations while at the same time providing updates for BillG and SteveB IN SEATTLE

#mix09 fact: ScottGu doesn't write code...oh no, he thinks about the finished product and the code appears.

#mix09 Scott Guthrie once won a game of Connect 4 in 3 moves.

Every time you attend #mix09 god saves a kitten.

If you don't <3 your web, #mix09 will track you down, and you WILL <3 your web, or else.

#mix09 fact: Attending a Mix session is like having 14 red bulls then cliff diving off of the side of the Venetian in the pool what happens in Vegas doesn't matter, unless it happened at #mix09.

#mix09 Chuck Norris has no need for virtual methods. Nothing can override Chuck Norris

#mix09 ScottGu codes better than anyone except Chuck Norris. Even then it's a tie.

If Chuck Norris went to #mix09, he could show us how to write threadsafe stateful code without locks If Chuck Norris went, #mix09 would not be about rich media. All forms of media would give Chuck Norris their money.

Chuck Norris has no need to go to #mix09. He has already been to mix20.

#mix09 there is no mix. Only a group of geeks chuck Norris let fly into vegas.

#mix09 facts: mix09 is so amazing that Chuck Norris, Vin Diesel and Jack Bauer won't attend out of fear MIX never ends, it just waits for Vegas to recover between keynotes.

After seeing the speaking schedule at MIX09, Chuck Norris took out a restraining order against ScottGu's keynote-fu.

New #mix09 Logos created using ONLY MSPaint

#1 for #mix09 logos with Paint by @sundermedia - Doesn't even look like me!

#2 for #mix09 logos with Paint by @encosia - Will it Blend^G^G^G^G^GMix?

#3 for #mix09 logos with Paint by @subdigital - No tools nor skill, but still a nice logo.

Honorable Mention for #mix09 logo: by @johnsheehan - Really?!? I mean, ORLY? - @shanselman a morning mspaint logo for ya #mix09

#mix09-related twaiku (twitter haiku)

a mix twoosh haiku? / very tall order this is / how 'bout free airfare?

Mix-0-9 for free ~ will leave me and Devs happy ~ not stuck in England...

Budget is frozen / Vegas is to far too drive / Guess I'll MIX next year :) I can't get to MIX / Please go and say hi for me / Can't wait for MIX 10. :-(

#mix09 Scraunched, scrounged, schmoozed, scratched code ~ finding strengths for Mix now vague ~ strengthed designs breakthroughs Shlepp coach: squirrelled, scrunched, scroonched; Wherethrough Mix: schmoozing, breakthroughs; Yields: Zeitgeist, choice spoils!

Get into the Mix | Meet lots of awesome people | Return with much swag

#MIX09 Free Tix For MIX Please / We Got TARP Funds Folks Are Pissed / Still Need To Learn Stuff Can't get in the MIX, even though I want to go, boss won't pay the price.

Why do I love Mix? Hot new tech from Microsoft Tix please, Hanselman. :) The new media / Converges at this show here / Go MIX it up now mix oh nine vegas, silverlight three will whisper, desktop apps for all

#mix09 haiku: i wish i could go / too few girl developers / gotta represent! ;)

#MIX09 haiku to best please the eye, learn to develop, design come to mix 09

#mix09 a web conference, with new web technology, time for MIX '09 developers flock, to #mix09 and neon lights, sure sign of spring i would love to goto mix, mix oh nine vegas, give me tickets please #mix09

#mix09 - Going to Vegas, I want to see new web tech, MIX '09, I come!

"hanselman presents / what happens at mix oh nine / stays in las vegas" #mix09 oh If I could mix - would it amend who I am - yes, hence I will mix Preconception's out / Content Is King in 09 / Delve into the Mix

Related Posts:

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 150 - Uncle Bob Martin, this time with feeling

February 19, '09 Comments [25] Posted in Back to Basics | Learning .NET | Podcast
Sponsored By

photo_martin_r My one-hundred-and-fiftieth podcast is up. He's back! And he's pissed! (Not really)

RWendi has a review and commentary of the past view week's goings on around Uncle Bob, Joel Spolsky and Jeff Atwood, sparked by Uncle Bob's discussion of  SOLID on show number 145. There's also a breakdown at InfoQ.

In this NEW episode, Scott sits down with Robert C. Martin as Uncle Bob (@unclebobmartin) tries to put the SOLID commandments principle into some perspective.

Here's some alternate titles for this show, suggested by the folks on Twitter!

  • "He's back and he's pissed."
  • "Bob's your Uncle."
  • "Joel Who?"
  • "SOLID State"
  • "I got your tests right here!"
  • "Smack Overflow"
  • "Pay Attention This Time: Bob Martin on SOLID"

(No, Bob's not pissed. We're just having a laugh.")

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show!

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET and Windows Forms. Enjoy the versatility of our new-generation Reporting Tool. Dive into our online community. Visit

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

Technorati Tags: SOLID,OOD,Uncle Bob,Software,Design

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Baby Sign Language 2.0 - Update at 14 months

February 18, '09 Comments [16] Posted in Musings
Sponsored By

If you're not interested in babies or baby sign language or hearing me gush about baby sign language, move right along, nothing to see here! (You're so heartless!)

This is Baby #2, codenamed "Mimzy" (he's a boy, don't ask), signing 'cracker' in ASL. He's 13 months old in the video. He's signing up a storm, and is speaking faster than I thought possible for a little dude. He's currently signing hard words and speaking easy ones, just as our older boy did. I suspect he's moving faster because he wants to be like his big brother.

His signing is a bit of an approximation, because just as toddlers don't pronounce words or "slur" for a while, who sign tend to "slur" for a while. Here's the actual ASL sign for "cracker" but he's really close. Most importantly, he can be understood.

Now, this isn't a "my baby is awesome and smart" post. Nor am I trying to say "push" your kid to do something earlier than is appropriate. I figure they'll all even out by the time they are 20 years old. ;) Not many college students live the house not speaking and still wearing diapers, so I don't push my kids too hard.

However, I'm just so passionate about the extra year of communication per baby that Baby Sign Language (ASL) gives us, and the quality of that communication, that I'll just gush and talk to anyone who will listen.

Baby #2 is now 14 months old and he's been signing for about 3 months. We've been signing to him since he was 7 months, so there was a 4 month people were he'd just grunt and point and look at us. From what I here, that's par for the course when you introduce signing to your baby. Most people say 6 months is the perfect time, but you should expect nothing for months. Stick with it.

It'll click one day, as it did for Baby #2. Out of nowhere he asked for a cracker. Then grapes, then an apple. If you've got young children, you're no doubt familiar with tantrums. If a kid doesn't feel understood or get what they want, they freak out. I can't tell you how refreshing and freeing it is for a baby (not yet a toddler, we're talking, a little wobbly baby) to ask specifically for grapes rather than apples. The benefits of avoiding the little freak-outs that are caused by simple misunderstanding or confusion are just joyous. To look at their face while they are saying/signing something - expressing their intent - clear as day, is such a great feeling. It's nice to find out that an 11 month old can do more than just grunt and point.

I really recommend the Signing Time videos if you're interested in signing with your baby. I am not affiliated with them, I just think they are awesome. Rachel Coleman and her husband have a deaf daughter and started Signing Time in 1996. Rachel blogs here and twitters as well.

Here's some resources from a previous post:

What do you need to do to start signing to your baby?

  • Check your local community center. They often offer Baby Sign Language classes. We took classes before #1 was born, and when he was 6 months old.
  • If Baby Sign Language is unusual or unused in your country, either find some Deaf Folks and learn your country's specific Sign Language, or use ASL (American Sign Language). The trick is to be consistent and have an illustrated dictionary to refer to.
  • Stick with it. Don't give up. We started when he was six months old and signed every day without a single clear response until he was a year old. We nearly quit a dozen times before that.
    • Then one day he signed "light" as clear as day in his bedroom. We turned on the light and our son lit up with a small as wide as his face. That's when we connected with him. I'm not talking about the standard Mom/Dad/Baby we-love-you connection. I'm talking about the baby's opinion matters kind of connection.
  • Get picture books, lots of them, and learn the signs for the animals. I highly recommend the Priddy Books series of books for baby.
    • Learn the signs for animals and common objects and use them every time you see one out in the world. We went for a walk on the Portland Waterfront today and our son was signing bird and dog and plane and sharing those discoveries with us. It's great when he sees something interesting and points at it, but it's something different when he signs about something we didn't see.
  • Pay Attention and prepare for the unexpected.
    • Example: The baby was frantically signing ball recently, gesturing wildly at a dog. We tried to correct him..."No no sweetie, that's a dog, not a ball." The dog lifted it's head and we saw that the dog was in fact playing with a ball that we hadn't seen.

I've blogged before (see below) at length about signing with your baby (or any non-speaking or slow-to-speak child) so I won't belabor the point, so here's some related posts.

If you've used Baby Sign Language, with or without success, I'd love to hear from you in the comments!

Related Posts

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Porting WPF Applications to the Microsoft Surface

February 18, '09 Comments [5] Posted in BabySmash | Windows Client | WPF
Sponsored By

What do you need to get through the Great Depression 2.0? Why, a giant computing table, of course! Sadly, the Surface SDK isn't available to folks without a real Surface (which, I say, is a bummer) so I can only tell you that developing for it is awesome. Lame, yes, I know.

I can't get you the SDK (yet?) or a Surface (I'm broke) but I can tell you what developing for it was like.

Of course, if you DO have an extra US$15,000 lying around, why not let your baby sit on it? That's my thinking.

BabySmash (Code and DevCenter here) has been on hold over the holidays, although I have a lot of big plans once I get on the other side of the Mix conference.

One of the things I talked about at my PDC BabySmash talk (WMV) was porting BabySmash to the Surface. BabySmash is a simple WPF application that responds to keyboard and mouse input. Since there's no keyboard or mouse in the standard Surface configuration, I wanted to see how had it would be to port it.

I had to deal with these changes in thinking:

  • Orientation matters. People might be sitting on opposite sides of the Surface
  • No mouse or keyboard. Many people can touch it at once.
  • Multifinger resizing. Folks expect to be able to multitouch a Surface and resize items, throw them around, etc.
  • Different application launcher model. The Surface needs an XML manifest and special icons for its launcher.

Other than these changes, a Surface app is still .NET WPF app, so I wasn't too worried.

Surface Simulator

The first step was to install the Surface Simulator. It only works on 32-bit Vista, so I had to go make myself a 32-bit machine (I'm all 64-bitted up. FTW!) which was a tiny hassle. (Although there ARE some Vista 64 Surface Simulator hacks) The Simulator is exactly what it sounds like. It's not "emulating" however, as a Surface is still a Vista machine underneath. It's more of a frame and some mouse input management to handle multiple mice and make them look like multiple fingers. This works surprisingly well. In the PDC talk, about halfway in, I plugged in three mice, plus the built in touchpad and had multiple virtual "fingers" moving items around the screen.

You create your Surface app as you would a WPF app from File | New Project, hit START and it fires up the Simulator and frames up the WPF app.

Now in my case, I already had an existing WPF application, so I needed to change the type my main Window derived from from "Window" to "SurfaceWindow" and I added an assembly reference and a few namespaces:

using Microsoft.Surface;
using Microsoft.Surface.Presentation;
using Microsoft.Surface.Presentation.Controls;

This base class adds adds all the Surfacey goodness and events and properties that my Window will need.

"ContactDown rather than KeyDown and MouseDown

I added an event for "Contact_Down" rather than watching for keyboard events and mouse clicks that would never come.

private void SurfaceWindow_ContactDown(object sender, ContactEventArgs e)
controller.AddFigure(this, " ", e.GetPosition(mainGrid).X, e.GetPosition(mainGrid).Y);

BabySmash uses an MVC model, so I'm taking the input from the View and immediately delegating to a main controller object that handles everything.


Your app can let the system decide which side of the Surface table the user is sitting on when it starts up. This isn't a huge deal with BabySmash, since it's just shapes, but still there's some text on the screen so I wanted the app to be right-side-up when appropriate.

There are a bunch of new properties on a SurfaceWindow, and one is:


This changed the orientation of my entire application, basically turning it upside down when need-be. This did mean that I couldn't use any low-level X and Y APIs, otherwise the coords would be "lost in translation." As long as I stuck with high-level stuff like "GetPosition" to pull my X and Y's out, the Surface SDK would handle translation and everything just worked.

Application Launcher Manifest

I needed to create a few icons for my app to live in the Surface Launcher and a manifest. There's other options I didn't use, as well as ways to create animated icons, or to have your application run as an "attract mode" app, to get folks wandering by to stop and touch the Surface.

<?xml version="1.0" encoding="utf-8" ?>

<Description>BabySmash! for Surface</Description>


In the original BabySmash app I had a canvas that would hold all the shapes and letters, but I wanted things to be more Surface-like in this (hacked-together) BabySurface version.

public void AddFigure(UserControl c, double x, double y)

Fortunately there's a control called a ScatterView that makes throwing stuff on the Surface insanely easy. For example:

<Image Source="Toco Toucan.jpg"/>
<Image Source="Green Sea Turtle.jpg"/>
<Image Source="Desert Landscape.jpg"/>

From their blog (here's a video of the Surface SDK in action):

ScatterView is a custom ItemsControl in our SDK which apps can databind or populate with any type of content. Simply sticking some Image elements in it gives you a basic Photos-like app without writing any code. By baking common manipulations into WPF SDK controls like this, we’re able to free developers up to focus on things that are unique to their apps while designers use Blend to add some custom pizazz.

I changed my AddFigure method to put the new shapes in a ScatterView. I also hooked up a "ContactLeave" event to the new item so that the application would giggle when you lift your finger.

public void AddFigure(UserControl c, double x, double y)
var s = new ScatterViewItem();
s.Content = c;
s.ContactLeave += new ContactEventHandler(s_ContactLeave);

This was cool, but it had a few issues. First, the ScatterView puts everything in a "Polaroid"  border by default:


The result was that my BabySmash shapes were inside a Photo Border. Easily removed with a custom style that marked a few properties as {x:Null}:

<Style x:Key="ScatterViewItemBabySmashStyle" TargetType="{x:Type s:ScatterViewItem}">
<Setter Property="Background" Value="{x:Null}"/>
<Setter Property="BorderBrush" Value="{x:Null}"/>
<Setter Property="Foreground" Value="{x:Null}"/>

The second issue was that while my BabySmash shapes were draggable and scattered nicely, they weren't resizable. Well, they WERE, except when you resized them, you were resizing the container - that is, resizing the now-invisible Polaroid border. I needed a box to put the shapes in that would effectively lie to the inner control and scale/size them as the outside scaled and resized. Enter the ViewBox, including with WPF.

public void AddFigure(UserControl c, double x, double y)
var s = new ScatterViewItem();
s.Center = new Point(x, y);
s.Style = this.Resources["ScatterViewItemBabySmashStyle"] as Style;

Viewbox v = new Viewbox();
v.Child = c;

s.Content = v;

s.ContactLeave += new ContactEventHandler(s_ContactLeave);

Link to Video of Developing on Surface from PDC 2007I put the Control in the ViewBox, and put the ViewBox+Control in a ScatterViewItem. Bam, resizable, scattered BabySmash shapes.

I also got dragging and inertia (physics) for free so you, ahem, the baby, can spin and throw shapes around as well.

This development was all done on the simulator. I never saw a real Surface until I got to PDC last year. The app ran exactly as should. I was a little worried that the real Surface was somehow different, but not so. That was a huge relief.

If you have a very visual, shape oriented application that could benefit from touch and a big screen, porting it to the Surface isn't rocket science.

Definitely check out the PC17 "Developing for Microsoft Surface" talk from PDC. There's a lot of good stuff in the PPT as well with insights into how Multitouch is going to work in .NET 4.0 and Windows 7 and how work on Surface now is driving that future.

And really, who WOULDN'T want a Big Ass Table? I, for one, would like one for the living room. ;)

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.