Showing posts with label SketchFlow. Show all posts
Showing posts with label SketchFlow. Show all posts

Monday, June 20, 2011

Programatically binding ComboBox in sketchflow to a Collection

After a lot of trial and errors, I got the right steps to bind a ComboBox to my collection class. Given below are the steps for anyone out there looking for a solution.

1. Set the ItemsSource property to the collection
2. Set the DataContext property to the collection
3. Set the DisplayMemberPath property to the name of a field in the collection.
4. Set the SelectedValuePath property to the name of a field in the collection.

this.cmbProjects.ItemsSource = Globals.AllProjects.Collection;
this.cmbProjects.DataContext = Globals.AllProjects.Collection;
this.cmbProjects.DisplayMemberPath = "Name";
this.cmbProjects.SelectedValuePath = "Name";

Saturday, June 18, 2011

Setting SelectedIndex property of combobox resulted in "Specified argument was out of range" exception

While working on a SketchFlow prototype, I got this exception
"Specificed argument was out of range"
when attempting to set the value of ComboBox.SelectedIndex in the LayoutRoot_Loaded event handler. It used to occur randomly, so I concluded that this could be the result of some behavior not entirely under my control.
I got rid of this exception by setting the SelectedIndex propertly in the ComboBox_Loaded event handler. Hope this helps someone there with a similar issue. :)

Friday, June 17, 2011

Mockup controls for SketchFlow.

If you are a newbie to Microsoft Expression SketchFlow, I highly recommend

1. Start making use of the Mockup controls. Given below is a blog post that describes how to get the controls to appear in the Assets pane.
http://blogs.msdn.com/b/expression/archive/2010/05/13/how-to-add-mockup-controls-to-your-expression-blend-library.aspx

2. Use Sketchables for rapid development
http://www.hardcodet.net/2010/07/public-sketchables-preview-release#comments

What is success?

The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...