locked
Does d:DesignInstance work in Blend 3 (Silverlight 3 project) RRS feed

  • Question

  • I am running Blend 3 and trying to edit a Silverlight 3 project. I just read about the feature with design time data context and was interested in trying it out.

    Basically I added a d:DataContext="{d:DesignInstance blend:MyClass}" to an element...but my class was never instantiated by blend. I did make sure that the blend namespace that I am prefixing has the right namespace declaration up above in the page and that I spelled my class name correct.

    Does anyone know if this is suppose to work?

    Thanks
    Tuesday, September 22, 2009 7:43 PM

All replies

  • Please free to get in touch with me directly at unnir at microsoft dot com and we can try to work this out:

    Some things to check:
    a) Is the type instantiable, i.e. does it have a public constructor, etc?
    b) Are you sure your constructor was never called?

    Thanks,
    Unni
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, September 22, 2009 8:33 PM
  • It works with the following declaration:

    d:DataContext="{d:DesignInstance blend:MyClass, IsDesignTimeCreatable=True}"

    The difference from what I had is that there is an extra property set...namely the IsDesignTimeCreatable.

    Thanks to Unni for helping me with this.

     

    Thursday, September 24, 2009 1:37 PM