Reputation: 2667
In the following Microsoft reference page:
https://msdn.microsoft.com/en-us/library/windows/apps/mt187344.aspx
..they identify two types of navigation models for UWP apps, single-page (recommended), and the multi-page. However, the terminology they use is quite ambiguous (documents?), and contradictory. Can someone please explain to me precisely the distinction between single-page and multi-page apps? Below is the excerpt that doesn't make much sense:
"UWP apps typically use a single-page navigation model. A single-page navigation model uses a single page to maintain app context and load additional data and content into a central frame, as needed. You still split your application into multiple files, but instead of moving from page to page, your app loads other documents into the main page frame. Because your app's main page is never unloaded, code and data is never unloaded, which makes it easier to manage state, and provide smoother transition animations between pages. We recommend using the single-page navigation model."
Upvotes: 1
Views: 159
Reputation: 34306
I read that page too and am somewhat confused by what they mean exactly. Here's my thoughts:
When I say "page" I mean a Windows.UI.Xaml.Controls.Page.
They explain the single-page model as "uses a single page" but then goes on to say "provide smoother transition animations between pages". Huh? I thought there was only a single page, so why would you be navigating between multiple pages? Also it mentions that the single-page model primarily relies on various methods of the Frame class like Navigate, GoBack and GoForward, but you wouldn't be doing this (or even using a Frame) at all if you only ever had a single page.
For most apps, I would recommend the following navigation model (whatever that ends up being called):
Page.Frame
property.Some apps have a hamburger menu a-la the SplitView control. In that case, the SplitView would be the content of the Window and the frame would be inside the SplitView instead.
Of course, you can do whatever you like that fits the needs of your app.
You don't typically have a frame within a page unless you have some very custom navigation structure.
Upvotes: 2