I was a little disappointed in the content of this presentation. There wasn't as many Tips & Tricks as I would have expected. One of the tips they attempted to show (which the demo actually failed) involved showing what happens when you try to access an object that isn't available on the Blend design surface... the result on the design surface is an exception that keeps you the user from previewing the UI. If I recall correctly they were were trying to check whether the Page object was available by checking the IsEnabled property, which seems a bit unusual. I have ran into similar issues with Blend and this is the trick I have used before accessing an object that may not be available when the UI is rendered on the design surface.
/// <summary>
/// Base class for all Parts in the Shell
/// </summary>
public class UIPart : System.Windows.Controls.UserControl, IPart
{
#region Constructors
/// Initializes a new instance of the <see cref="UIPart"/> class.
public UIPart()
//if we don't check this... the UI will not display correctly in the designer.
if (InDesignMode)
return;
partIdField = this.GetType().Name + "_" + Guid.NewGuid();
this.GotFocus += UIPart_GotFocus;
this.Loaded += UIPart_Loaded;
this.IsVisibleChanged += UIPart_IsVisibleChanged;
this.Initialized += UIPart_Initialized;
}
/// Gets a value indicating whether [in design mode].
/// <value><c>true</c> if [in design mode]; otherwise, <c>false</c>.</value>
public bool InDesignMode
get { return System.ComponentModel.DesignerProperties.GetIsInDesignMode(this); }
One thing that I did gleam from the talk was that there is a new version of Snoop available that has the capability to render the composition of an application in a 3D model, the composite model of Blend is shown below:
Posted in PDC 2008 |Comments [2]
Sysknowlogy