Monday 2 June 2008

Homer H1: Install and play

For my first session on my new lunchtime learning project I:
  • Installed .Net 3.5 (I already have vb6, vs 2003 pro and vs2005 dev but haven't moved to 2008 yet).
  • Installed Blend 2.5 March 2008 preview
  • Started learning the hard way....

Ok I should have read a load of tutorials, poured over examples etc but what I choose to do was play all the samples and then start trying to animate an ellipse. This is when it all started to unravel. Here's what happened:

  • I started MS Expression Blend and added a Silverlight Project (VB.Net version).
  • I drew an ellipse.
  • I added a storyboard, moved the ellipse and stopped the recording.
  • I pressed play and nothing happened so I moved the little mark in the timeline.
  • With the ellipse animated I added a button.
  • I spent 30 mins trying to connect the button click to the ellipse anim.

I turns out that the help files description of "Add or remove a trigger" no longer applies to this build of Blend when working on Silverlight projects (see: Where is the Triggers Pallet in 2.5 March). So I attempted to hook the event manually as suggested in the last post in the thread but in Vb.Net, this resulted in:

Page.XAML.VB

Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Shapes
Partial Public Class Page
Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
Public Sub Mouse_Clicked(ByVal sender As Object, ByVal e As MouseEventArgs)
Call storyboard1.Begin()
End Sub
End Class

This caused a "type 'MouseEventArgs' is not defined" error. It turns out that it should be defined as RoutedEventArgs (see Create a new event handler method).

The end result is below (21kb wmv from Windows Media Encoder 9)

That's it for now.

Starting with Silverlight

Ok, I'm finally getting started. I'm attempting to learn enough to put a Silverlight 2 application together.

The basic idea is to have a browser based interface that will allow office workers to mark themselves as present in the office or out on a clients site (a full spec is still being dreamt up).

I'm hoping to put a tablet pc by the office entrance so the UI needs to be finger friendly. As an update occurs at the door I'd like to push the data to any client with the application open. In a recent .Net Rocks podcast Dan Wahlin suggested that sockets would be a good way forward (see article One and Two). However I'm starting with a look at the UI, the back-end will follow.

As this is a homer (for now) things will happen in small chunks, I therefore plan to blog each [lunch] hours progress.......

Friday 11 April 2008

Play And Publish (PAP)

Noun.
1. Nonsense, rubbish.
2. Faeces.

Lets hope not !