5

I have these files.

"Control.cs" [this has method activateabc()] and "abc.xaml" in an assembly (created as a Class Library) and I have referred it in my working project(Windows Phone 8.1 Runtime App). I have added Frame.Navigate(typeof(abc)) within the activateabc() and when I call activateabc() from the working project it throws XAMLPARSEEXCEPTION.

Any idea how do I navigate to XAML page in another assembly? Also I have no dots or hypens or underscores in any of my assembly names.

Edit: NavigationService.Naivage()is available in Windows Phone 8 to do the job. However, Frame.Navigate() allows navigation to a type rather than to a URI as in WP8. So please tell me a way how to navigate to a XAML page in different assembly in Windows Phone 8.1 Runtime Apps

Christopher
  • 107
  • 9
  • http://stackoverflow.com/questions/20420182/how-to-navigate-to-another-project-inside-same-solution – Marshal Jun 08 '15 at 07:06
  • NavigationService.Navigate works on WIndows Phone 8. It has been deprecated in WIndows Phone 8.1 and replaced by Frame.Navigate(). My question is for **Windows Phone 8.1** – Christopher Jun 08 '15 at 07:15
  • I think this person has [exactly the same problem](http://stackoverflow.com/questions/28071841/frame-navigate-to-a-page-derived-class-in-a-different-assembly) unfortunately unsolved. May be you can raise a bounty later – Marshal Jun 08 '15 at 07:31
  • I am actually able to navigate to the 'Page' in the different assembly but when I press back the application exits. This is may be because the assembly consists of Navigation Frame of its own and when I press back there is no other page behind in the Frame of assembly. How can I solve this ? Any feedback will be appreciated. Thanks in advance – Sunil Kumar S C May 05 '16 at 04:43

1 Answers1

0

Can you provide more information please? I don't have an answer but I do have some additional information that might help.

Do you know if it's failing to parse the xaml markup or is it in truth failing to find the abc.xaml file? I bet this is the real problem. If it's failing to find the file you might need to modify the xaml file Uri to include the assembly name. I don't know how to override the default file load location for pages since that code gets generated but the Uri would look like this.

If your assembly is MyCustomControls.dll then the Uri would be new Uri("ms-appx:///MyCustomControls/abc.xaml").

If your xaml file is found but some markup is failing you might try to comment out all the markup until there is no load failure then comment it back in by bits until you isolate which bit of markup seems to be the problem. It might be some namespace resolution issue in the app's xamltypeinfo.g.cs. I doubt this is the issue though since you say you added the assembly as a reference.

I hope some of the above information is useful.

DrewCan
  • 71
  • 3