Navigate to a Page of another Class Library

后端 未结 2 1349
说谎
说谎 2021-01-23 15:04

I need to create several versions of a core project. Few things can change between core project and its extensions, some functionalities and, above all, design (Fonts, colors, e

相关标签:
2条回答
  • 2021-01-23 15:07

    Luckily there is a workaround by Daniel Vaughan (http://danielvaughan.org/post/UWP-AccessViolationException-when-Navigating-to-a-Page-in-Another-Assembly.aspx):

    • create a Dummy.xaml in the startup project
    0 讨论(0)
  • 2021-01-23 15:12

    halllo's answer only works for me in Debug build. When I build/deploy in Release build, the problem is still there. Instead, I just remove the Navigation code and assign the content directly. So far my app works well (since I don't need Navigation, it's a single WebView app) but I do not know if there will be any problem.

    // rootFrame.Navigate(typeof(MainPage), e.Arguments);
    // Remove the above default line
    // MainPage is a C# class that inherits a Page in my library
    rootFrame.Content = new MainPage();
    
    0 讨论(0)
提交回复
热议问题