locked
DesignInstance broken in Blend for C++ apps?

    Question

  • I've created my own Sample class for design-time in a separate project in my C++ app (which was created using the Split Application template). When I change the d:Source attribute of the CollectionViewSource resource in the ItemsPage.xaml file thusly:

    d:Source="{Binding Feeds, Source={d:DesignInstance Type=data:SampleFeeds, IsDesignTimeCreatable=True}}"

    Blend's XAML view puts squiggly red under the line with the tooltip "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))".

    Obviously, the sample data items are not showing up in the designer.

    This is not happening in the Visual Studio 11 Beta designer, which accepts the XAML and displays the sample items in the design view.

    Is there something I need to do to my SampleFeeds class to make it work in Blend, or is this a bug?

    Cheers,
    Mark

    • Moved by Jesse Jiang Monday, May 14, 2012 10:54 AM (From:Building Metro style apps with C++ )
    Saturday, May 12, 2012 2:25 PM

All replies

  • Hi ,

     

    I think your issue should be raised in the Tools for Metro style apps. I believe they will know more information of this issue than us, and I will move this one to that forum.

     

    Thanks for your understanding,

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, May 14, 2012 10:53 AM
  • Hi Mark, is your SampleFeeds class brief enough to post here (or can it be made so)? I tried to repro the issue by making a copy of the SampleDataSource class, renaming it SampleFeeds and then changing the AllGroups property name to Feeds, and changing the xaml. That works fine for me, although interestingly in Blend I get the same exception you get, temporarily (it resolves in a few seconds), both during the build immediately after creating the new project from the template with zero changes, and then again after I made the changes to the code (I used VS for that). By the way, would it work for you to use Windows::ApplicationModel::DesignMode::DesignModeEnabled to guard the instantiation of the design-time data? If you wrapped that in precompiler directives you could even have it compiled out of the retail build.

    Cheers!

    Steve White (Blend Program Manager)

    Wednesday, May 16, 2012 12:34 AM