One of the cool things about PDC is that you can play around with technology almost nobody have been playing around with, and today I got to test the Surface Platform.
If you are one of the guys who know how to code with WPF, then its really simple. All you need to do is to add a reference to the Surface.Presentation.dll, and instead of using the standard WPF controls( InkerCanvas, Button, Slider, Checkbox ++ ) you will need to use the Surface versions. These are simply SurfaceButton, SurfaceSlider, SurfaceCheckBox and so on.So, if you got a WPF application you would like to try on a surface machine, just do these two steps and your done! 🙂
The Surface Platform got a control named ScatterView that can be used to f.ex scale, rotate and decelerate custom controls (xaml).You can set properties on objects like CanRotate, CanScale,DecelerationRate and so on to make the object interact in the ways you want.
To create a nice photoablum, all you need to do is to make a ScatterView with a DataSource pointing to a directory of image-files, and the ScatterView takes care of the rest. Nice!
To play with the really cool things about Surface, you can make it recognize objects by using a tag and the TagVisualization control. Things like adding a tag to a business card, and when putting the card on the table, a ring will popup with options like sending an e-mail to the owner, call him/her up and so on is quite simple to do.
All Surface applications needs to be hosted inside a SurfaceWindow and declare a namespace for surface:
And a scatter window can be defined as the following, using a data template that displays images for a data bound collection:
<s:ScatterView Grid.Row="1" Name="MyPictures" >
<!–A template for displaying an image from a databound collection of image file paths–>
Now, you can easily iterate trough all pictures in a folder, adding a new ScatterViewItem and setting a picture as it’s content. When a new ScatterViewItem is created, you can then add them to the Items collection in MyPictures: MyPictures.Items.Add(sviewitem);
As simple as it gets! ;D