Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Silverlight 1.1 Alpha Refresh - Name Things :-)
Mike Taulty's Blog

Mike's Badges

Follow on Twitter
View mike's profile on slideshare
Add to Technorati Favorites
CW Blog Awards

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

Comments

Mike Ormond's Blog wrote Moving to Silverlight 1.1 Alpha Refresh - A Quick Checklist
on Mon, Aug 6 2007 6:07 AM
Here are a few things you'll have to change in your Silverlight 1.1 apps to get them working with the
Noticias externas wrote Moving to Silverlight 1.1 Alpha Refresh - A Quick Checklist
on Mon, Aug 6 2007 6:36 AM
Here are a few things you'll have to change in your Silverlight 1.1 apps to get them working with
MSDN Blog Postings » Moving to Silverlight 1.1 Alpha Refresh - A Quick Checklist wrote MSDN Blog Postings » Moving to Silverlight 1.1 Alpha Refresh - A Quick Checklist
on Mon, Aug 6 2007 7:07 AM
(C) Mike Taulty, 2009. All rights reserved. The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems