locked
Setting TemplatePart attribute

    Question

  • How do I define the System::Type that is required by the TemplatePartAttribute?

    Ie how do I define that my control has a template part named 'ContentBorder' of type 'Border^'?

    [Windows::UI::Xaml::TemplatePartAttribute(Name="ContentBorder", Type=????)]
    public ref class MyControl : public Control
    {
    }




    Sunday, June 03, 2012 8:24 PM

Answers

  • Tuesday, June 05, 2012 1:27 AM
  • @Morten - okay 2 things here.  First, this does appear to be a bug that the C++ team is aware of (your compile error once you set the type name correctly).  Second though, the Parts model isn't enabled in Blend for WinRT (i.e., no design experience for Parts).  If this is what you were annotating it primarily for, then you may not need it as that won't be enabled.  However, if you were using the Parts metadata for other reasons, then you'll have to wait until RTM for the fix.

    Tim Heuer | Program Manager, XAML | http://timheuer.com/blog | @timheuer

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)

    Tuesday, June 05, 2012 3:48 AM

All replies

  • Tuesday, June 05, 2012 1:27 AM
  • @Morten - okay 2 things here.  First, this does appear to be a bug that the C++ team is aware of (your compile error once you set the type name correctly).  Second though, the Parts model isn't enabled in Blend for WinRT (i.e., no design experience for Parts).  If this is what you were annotating it primarily for, then you may not need it as that won't be enabled.  However, if you were using the Parts metadata for other reasons, then you'll have to wait until RTM for the fix.

    Tim Heuer | Program Manager, XAML | http://timheuer.com/blog | @timheuer

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)

    Tuesday, June 05, 2012 3:48 AM
  • Thanks for the clarification Tim. I'm using this for two reasons: Blend design experience (it's a problem that's not part of Blend), and secondary for documentation purposes.
    Thursday, June 07, 2012 5:57 PM
  • It looks like this never got fixed at all.

    Any update on to why the consistency is missing from the C++ implementation?

    Cheers


    Expression MVP

    my blog : http://brennonwilliams.com

    Tuesday, July 02, 2013 8:39 AM