Archive for September 28th, 2009

Code Cast 32 – Tommy Norman

At the Agile 2009 conference in Chicago, I got to meet some great people I’d previously known only in electronic form. Tommy Norman is one of those folks, as he and I have had many conversations on Twitter. Tommy is a System Architect at Compuware in Nashville, TN where focuses on Application Lifecycle Management. He is also heavily into Scrum, Team System, and the Nashville .NET User Group. When not working he enjoys being at home with his family of 5, playing guitar and baby dolls, and making music.

In this episode, Tommy visited with me about effectively applying Team System to some agile software development practices. This ranges from Continuous Integration to the tool aisle at your neighborhood Sears store, but I’ll leave that for you to discover.

Get the show here

View in iTunes Any Podcatcher


jQuery and AIR – Moving from web page to application

This blog entry discusses a new jQuery-based AIR game, Hangman. It doesn't yet make much use of the AIR platform, but further enhancements will demonstrate how we can effectively use jQuery and AIR together.

A “Default Command” for Silverlight

The current Silverlight application that I’m building has a Login view. One of the things that bugged me when I started using the application is that you would have to click the Login button after typing your password. I wanted to duplicate the default button behavior of HTML forms where when you hit the enter key it would trigger the default button on the form. I did some googling on the subject and came across this post by Patrick Cauldwell which is one way to solve the problem. However, in my case I had a username Textbox, a password Passwordbox, and a company Combobox and didn’t want to specify the button for each control.

So I create a simple solution of creating a content control that attaches to all the KeyUp events of all the child FrameworkElements in the content. To do this I used the FindChildren<T> extension method from the Avanade Silverlight Accelerator which is a toolkit we use internally at Avanade to speed up Silverlight development. The ContentControl exposes a DefaultCommand property which you then bind to the ICommand property on your ViewModel.

Below is a trimmed down example of the Login view. I’m using a variant of the RelayCommand/DelegateCommand as the LoginCommand here (see Laurent’s post on the RelayCommand for a good overview of Commands in Silverlight).

<ctrls:FormControl DefaultCommand="{Binding LoginCommand}">   
  <TextBox Text="{Binding Username, Mode=TwoWay}" />
  <PasswordBox Password="{Binding Password, Mode=TwoWay}" />
  <Button IsEnabled="{Binding LoginEnabled}" 
          cmds:ButtonClickCommand.Command="{Binding LoginCommand}" 
          Content="Login" />
</ctrls:FormControl>

There are many other things you could add to this but this is all the functionality that I needed and I decided to keep it simple. Download the class file (plus the extension method) below. Let me know if you find it useful!




A “Default Command” for Silverlight

The current Silverlight application that I’m building has a Login view. One of the things that bugged me when I started using the application is that you would have to click the Login button after typing your password. I wanted to duplicate the default button behavior of HTML forms where when you hit the enter key it would trigger the default button on the form. I did some googling on the subject and came across this post by Patrick Cauldwell which is one way to solve the problem. However, in my case I had a username Textbox, a password Passwordbox, and a company Combobox and didn’t want to specify the button for each control.

So I create a simple solution of creating a content control that attaches to all the KeyUp events of all the child FrameworkElements in the content. To do this I used the FindChildren<T> extension method from the Avanade Silverlight Accelerator which is a toolkit we use internally at Avanade to speed up Silverlight development. The ContentControl exposes a DefaultCommand property which you then bind to the ICommand property on your ViewModel.

Below is a trimmed down example of the Login view. I’m using a variant of the RelayCommand/DelegateCommand as the LoginCommand here (see Laurent’s post on the RelayCommand for a good overview of Commands in Silverlight).

<ctrls:FormControl DefaultCommand="{Binding LoginCommand}">  <TextBox Text="{Binding Username, Mode=TwoWay}" />
<PasswordBox Password="{Binding Password, Mode=TwoWay}" />  <Button IsEnabled="{Binding LoginEnabled}" cmds:ButtonClickCommand.Command="{Binding LoginCommand}" Content="Login"
/> </ctrls:FormControl>

There are many other things you could add to this but this is all the functionality that I needed and I decided to keep it simple. Download the class file (plus the extension method) below. Let me know if you find it useful!


  • Sponsored Links

  •  

    September 2009
    M T W T F S S
    « Aug   Oct »
     123456
    78910111213
    14151617181920
    21222324252627
    282930  
  • .

    Copyright © 1996-2010 Answer My Query. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress