Sunday, September 12, 2010

Visual Studio Editor Extension for Code Contracts

Just a quickie. The DevLabs team have released an editor extension for Code Contracts which allows you to view the contract requirements for a given method in intellisense. It can be downloaded from the Visual Studio gallery here or the DevLabs Code Contracts site. Two things to note are that it is only for Visual Studio 2010 and currently only works with C#.

Thursday, September 09, 2010

Silverlight and the TabNavigation Property

In Silverlight 3 and onwards there is a TabNavigation property on controls that can have one of three values: “Once”, “Cycle” and “Local”. These values modify the tabbing behaviour of your application and it is worth knowing what affect each one has.

The following are some rough notes that have come out of playing around with these values

  • Setting the root user control’s TabNavigation property to “Local” (with all of its child controls tab navigation also set to “Local”) will navigate through all of the tabbable controls in the Silverlight app and then move out to the browser controls and eventually return to the app.
  • Setting the root user control’s TabNavigation property to “Cycle” will limit the tabbing to only the Silverlight app.
  • Setting the root user control to “Once” is just stupid.
  • If you set a control such as a textbox to “Cycle” once you hit that control you will never be able to tab out of it. If the control is a listbox or similar and it’s TabNavigation is set to “Cycle” tabbing will cycle through that  control’s child items.

These were quick observations and there are probably other quirks that need to be identified but that will do for the moment.