locked
Navigate to XAML Page defined in class library

    Question

  • Hello,

    I am trying to create a class library for Windows Store apps, from an existing library for Windows Phone.

    In this class library, I define some XAML files. If I try to navigate to one of these pages from outside the class library, this works well for WP apps, but not for Windows Store apps. I get an exception :

    Windows.UI.Xaml.Markup.XamlParseException : XAML parsing failed.

    In my project, I reference only the dll of my class library. The assembly name does not contain a dot, and the assembly name and default namespace are the same (I saw a couple of issues about these properties). And still I get the exception.

    I saw in a forum that XAML pages were not embedded in the dll, as opposed to WP dll. Is this true ? I guess it is the reason why the exception occurs, but I can't find any official documentation about this. Why this change ?

    I can reference the XAML pages as well from my project, or create an extension as i saw on a blog post, that would embed the code + XAML. I just want a confirmation, something "official" that states this diagnosis is the correct one.

    Thank you in advance,

    Dam.

    Thursday, February 27, 2014 9:18 AM

Answers

  • You are correct.  XAML pages are not embedded inside DLLs in Windows Store apps. Your extension idea is a good one.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by la_urre Thursday, February 27, 2014 4:30 PM
    Thursday, February 27, 2014 1:32 PM
    Moderator

All replies

  • You are correct.  XAML pages are not embedded inside DLLs in Windows Store apps. Your extension idea is a good one.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by la_urre Thursday, February 27, 2014 4:30 PM
    Thursday, February 27, 2014 1:32 PM
    Moderator
  • Cheers Matt !

    Thursday, February 27, 2014 4:31 PM