If you're writing code that dynamically generates "things" (Storyboards and so on) with the V1.1 Alpha Refresh then don't forget to give them a name (i.e. from a XAML perspective this is typically what you set with "x:Name" (using the convention of x there)) and from a code perspective this is DependencyObject.NameProperty otherwise I think you'll get failures.
I've been using Guids where I don't have a genuine name for an object. You might even in the C# 3.0 world have pseudo-code (not in front of a compiler as I write this) like;
public namespace XamlExtensions
{
public static class XamlExtensions
{
public static void MakeUniqueName(this DependencyObject o)
{
string guid = Guid.NewGuid().ToString();
o.SetValue(DependencyObject.Name, guid.ToString());
}
}
}
Posted
Mon, Jul 30 2007 2:23 PM
by
mtaulty