当前位置: 动力学知识库 > 问答 > 编程问答 >

.net - Using NavigationService without XAML files

问题描述:

I'm trying to create some pages in my Windows Phone application without the use of any XAML. Everything is working, however, I'm failing to use NavigationService/ Journal with this approach and all my attempts to utilize it are answered by the usual "No XAML was found at the location {0}'" response. Yes, I can add an almost empty XAML file to get everything working, but is this kind of boiler plate code really necessary?

Is it maybe possible to use the UriMapping to map certain Uris to specific classes instead of *.xaml files?

网友答案:

Even with UriMapping, you'll have to use a valid XAML page. And cancelling the navigation in the Navigating event will prevent the page to be added to the back stack. So using a dummy page is probably the best way if you want to be able to use the navigation service and the journal.

网友答案:

What you are trying to do is I guess against the WindowsPhone guidelines and hence your app may get rejected from the market place.. please verify on this first

网友答案:

MS did a couple of very sloppy and blatantly wrong design "choices" by forcing programmers to use XAML at any cost and therefore creating WP apps or even navigating in those apps without XAML is not possible (yet?). I have high hopes their interns are going to fix this during their next semester ...

分享给朋友:
您可能感兴趣的文章:
随机阅读: