Page navigation and media views
Page navigation gives Screenbox one path from app-wide navigation to media browsing, playback, queue management, search, and settings. The main page owns the shell, while each page view model owns the state and actions for its workflow. This page complements Application shell and UI controls and theming.
Navigation model
The navigation model separates the app shell from the content views. A view model is the page state and actions that the view exposes to the user. The shell keeps a content route and a player route so playback can remain available while the user browses.
The main navigation presents these user areas:
| Area | User workflow |
|---|---|
| Home | Open media and manage recent items |
| Music | Browse songs, albums, and artists |
| Videos | Browse video folders or all videos |
| Network | Browse connected media servers and folders |
| Play queue | Review and add items to the current queue |
| Playlists | Manage saved playlists |
| Settings | Change library, playback, language, and app options |
The shell also provides search. Search can start playback or open a media detail view without first opening a library page.
This diagram shows how the shell routes users to content views while keeping the player as a separate surface.
flowchart TD
Nav[Main navigation] --> Main[Main page]
Main --> Home[Home]
Main --> Music[Music views]
Main --> Videos[Video views]
Main --> Network[Network folders]
Main --> Queue[Play queue]
Main --> Settings[Settings]
Main --> Search[Search results]
Main --> Player[Player surface]
Music --> MusicChildren[Songs, albums, artists]
Videos --> VideoChildren[Folders, all videos]
Network --> FolderViews[Folder list and folder content]
Search --> Detail[Media detail or playback]
Shell navigation
Screenbox/Pages/MainPage.xaml is the app-level navigation surface. MainPage maps navigation tags to pages, prevents duplicate top-level entries, updates the selected item after child navigation, and handles back requests from the player or the active content frame. Its MainPageViewModel supplies search suggestions, starts library loading, and shares player visibility with the shell. References: Screenbox/Pages/MainPage.xaml#L76-L246, Screenbox/…/MainPage.xaml.cs• L29-103, Screenbox/…/MainPage.xaml.cs• L139-163, Screenbox/…/MainPage.xaml.cs• L201-247, Screenbox.Core/…/MainPageViewModel.cs• L23-101
Back navigation
Back navigation follows the most local active workflow first. It closes an open navigation pane, leaves the visible player when needed, then gives an embedded content page a chance to go back before using the shell content history. This keeps folder paths and library sub-pages from competing with app-level navigation. References: Screenbox/…/MainPage.xaml.cs• L179-225, Screenbox/…/MusicPage.xaml.cs• L20-75, Screenbox/…/VideosPage.xaml.cs• L20-81, Screenbox/…/NetworkPage.xaml.cs• L21-64
Home and library views
Home and library pages turn shared media state into user-facing entry points. They expose commands for opening media and folders, then send play or queue actions to the shared playback workflow instead of owning playback themselves.
Home view
The Home page is the quick-start view for recent media. It loads recent files from the system recent list, removes entries that are no longer valid, and lets users play, queue, remove, or select several items. Its open actions also accept files, folders, and URLs, so Home is a general entry point for starting playback. References: Screenbox/Pages/HomePage.xaml#L91-L195, Screenbox/…/HomePage.xaml.cs• L14-38, Screenbox.Core/…/HomePageViewModel.cs• L26-89, Screenbox.Core/…/HomePageViewModel.cs• L109-125, Screenbox.Core/…/HomePageViewModel.cs• L276-353
Music view
The Music page groups music workflows under one page-level navigation surface. Users can switch between songs, albums, and artists without leaving the music area. The page restores its child navigation state and updates its empty state when the shared music library changes. References: Screenbox/Pages/MusicPage.xaml#L22-L140, Screenbox/…/MusicPage.xaml.cs• L20-75, Screenbox.Core/…/MusicPageViewModel.cs• L15-60
Video view
The Videos page supports two ways to reach video: a folder path and a library-wide list. Folder browsing shows breadcrumbs and preserves the current child route, while the all-videos view removes the folder path from the main presentation. The page view model also exposes the add-folder action and reports whether the library has content. References: Screenbox/Pages/VideosPage.xaml#L22-L149, Screenbox/…/VideosPage.xaml.cs• L20-113, Screenbox.Core/…/VideosPageViewModel.cs• L22-68, Screenbox.Core/…/VideosPageViewModel.cs• L86-120
Empty library views
Music and video views replace their tabs and content frame with a clear empty state when their library has no usable media. The empty state keeps the next useful action visible: add a music folder or add a video folder. References: Screenbox/Pages/MusicPage.xaml#L96-L158, Screenbox/Pages/VideosPage.xaml#L106-L167, Screenbox.Core/…/MusicPageViewModel.cs• L35-59, Screenbox.Core/…/VideosPageViewModel.cs• L47-62
Folder and network views
Folder views provide a common browsing workflow for local libraries, removable storage, query results, and network media. They keep a display breadcrumb list and a matching folder location list so a user can move between levels and still return to the correct source.
Folder view
The folder view turns a storage source into browsable items. A folder click opens the next level, a media click starts playback, and context actions add media to the queue or play it next. The view model also collects playable items from the current folder so starting one item can establish the folder as a playback group. References: Screenbox/Pages/FolderViewPage.xaml#L35-L127, Screenbox/…/FolderViewPage.xaml.cs• L17-62, Screenbox.Core/…/FolderViewPageViewModel.cs• L22-95, Screenbox.Core/…/FolderViewPageViewModel.cs• L137-189, Screenbox.Core/…/FolderViewPageViewModel.cs• L217-241
Breadcrumb navigation
Breadcrumb navigation is a route back to any known folder level. The displayed names are kept separate from the storage folders that perform navigation. A breadcrumb click therefore creates a new route with the correct root context instead of only changing the label. References: Screenbox/…/FolderViewPage.xaml.cs• L81-84, Screenbox.Core/…/FolderViewPageViewModel.cs• L76-95, Screenbox.Core/…/FolderViewPageViewModel.cs• L100-129
Network view
The Network page applies the folder workflow to connected media servers. It starts at the system media-server location, shows the current server path as breadcrumbs, and changes to a no-network state when the source has no usable content. The empty state points the user to the system connected-devices settings. References: Screenbox/Pages/NetworkPage.xaml#L22-L70, Screenbox/…/NetworkPage.xaml.cs• L21-93, Screenbox.Core/…/NetworkPageViewModel.cs• L9-42
Player and queue views
The player and queue views are two faces of one playback workflow. The queue supplies the current media sequence, while the player presents the active item and sends playback actions through shared playback state.
Player view
The Player page can be hidden, reduced to a minimal surface, or shown as the main playback view. It adapts its content for audio and video, displays current media and playback state, and exposes seek, volume, rate, frame, resize, drag-and-drop, and fullscreen workflows. Player visibility is shared with the shell, so opening the player changes the shell layout and back behavior. References: Screenbox/…/PlayerPage.xaml.cs• L32-71, Screenbox/…/PlayerPage.xaml.cs• L180-239, Screenbox/…/PlayerPage.xaml.cs• L319-384, Screenbox.Core/…/PlayerPageViewModel.cs• L32-169, Screenbox.Core/…/PlayerPageViewModel.cs• L182-303, Screenbox.Core/…/PlayerPageViewModel.cs• L721-827
Queue view
The Play Queue page gives users a full view of the active queue and entry points for adding files, folders, or URLs. It delegates queue changes to the queue coordinator, while the shared queue state keeps the current item and ordering visible to the player and other pages. References: Screenbox/Pages/PlayQueuePage.xaml#L48-L117, Screenbox/…/PlayQueuePage.xaml.cs• L13-29, Screenbox.Core/…/PlayQueuePageViewModel.cs• L16-63
Playback coordination
Media pages do not create separate playback sessions for each view. They send play, play-next, and add-to-queue actions through shared messages and queue services. The player listens for the current queue item, loads the media details it needs, and updates its view state when the queue changes. References: Screenbox.Core/…/HomePageViewModel.cs• L276-353, Screenbox.Core/…/FolderViewPageViewModel.cs• L144-175, Screenbox.Core/…/SearchResultPageViewModel.cs• L116-127, Screenbox.Core/…/PlayerPageViewModel.cs• L282-303
Search and settings views
Search and settings cross-cut the main page workflows. Search finds media across the local library, while settings changes the shared contexts that control later library, playback, and presentation behavior.
Search view
The shell search box provides suggestions while the user types. Submitting a query opens a result view with grouped artists, albums, songs, videos, and playlists. The result view shows a useful first set, offers a full result route for groups with more items, and sends media selection to playback or detail navigation. References: Screenbox/Pages/MainPage.xaml#L203-L227, Screenbox.Core/…/MainPageViewModel.cs• L154-223, Screenbox/Pages/Search/SearchResultPage.xaml#L97-L180, Screenbox/…/SearchResultPage.xaml.cs• L15-42, Screenbox.Core/…/SearchResultPageViewModel.cs• L15-114, Screenbox.Core/…/SearchResultPageViewModel.cs• L116-156
Settings view
The Settings page is the control point for library locations, recent history, playback behavior, language, theme, frame capture, removable storage, and advanced player options. It loads current locations when entered and sends library refresh requests after library settings change. Some player, language, and advanced options mark the app for relaunch because they affect startup behavior. References: Screenbox/Pages/SettingsPage.xaml#L112-L180, Screenbox/…/SettingsPage.xaml.cs• L18-64, Screenbox.Core/…/SettingsPageViewModel.cs• L24-126, Screenbox.Core/…/SettingsPageViewModel.cs• L128-180, Screenbox.Core/…/SettingsPageViewModel.cs• L294-316, Screenbox.Core/…/SettingsPageViewModel.cs• L416-445
Shared view state
Page view models use shared library, recent, queue, player, and settings state so a change in one page can update another page without a direct page-to-page dependency. For example, a queue change updates Home recent items and the Player view, while a library refresh updates the Music and Videos content states. References: Screenbox.Core/…/HomePageViewModel.cs• L26-83, Screenbox.Core/…/MusicPageViewModel.cs• L15-44, Screenbox.Core/…/VideosPageViewModel.cs• L22-62, Screenbox.Core/…/PlayerPageViewModel.cs• L32-41
Change checklist
When these files or sections are changed, remember to consider these:
- A top-level route change must keep the
MainPagepage map, navigation tags, selected-item lookup, and navigation metadata aligned. - A music or video child route must keep its child page map, saved navigation state, and restored selected tab aligned.
- A folder or network route change must preserve both breadcrumb labels and the storage-folder path used for navigation.
- A player visibility change must update the shell visibility message, player visual states, and back-navigation priority together.
- A new search result group must update its result data, visibility and “see all” state, and destination route as one contract.
- A setting that affects startup must be included in the relaunch decision as well as its settings context binding.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A navigation tag has no matching page type | The selected item does not open the intended page or cannot be restored after child navigation | Keep the shell map and XAML tags as one route contract |
| A child page does not save its frame state | Returning to Music or Videos loses the selected view and its back path | Save and restore the child frame state with the page lifecycle |
| Breadcrumb labels and folder locations diverge | The breadcrumb text points to one level while navigation opens another | Update both lists from the same folder path |
| A library is empty or access is denied | The user sees no media and may not have a working add-folder action | Keep content state and library availability tied to the shared library context |
| Player visibility changes without shell state coordination | The shell can remain visible behind the player or route Back to the wrong frame | Propagate player visibility and use the shell back priority |
| A startup-only setting changes without a relaunch | The settings page shows the new value but the running player still uses old startup behavior | Set the relaunch-required state when the startup contract changes |
Key files
| File | Why to read it |
|---|---|
| Screenbox/…/MainPage.xaml.cs and Screenbox.Core/…/MainPageViewModel.cs | App-level routes, search entry, library startup, player visibility, and back behavior |
Screenbox/Pages/HomePage.xaml and Screenbox.Core/…/HomePageViewModel.cs | Recent media and the main open, play, queue, and remove workflow |
| Screenbox/…/MusicPage.xaml.cs and Screenbox/…/VideosPage.xaml.cs | Child library routes and saved navigation state |
| Screenbox.Core/…/MusicPageViewModel.cs and Screenbox.Core/…/VideosPageViewModel.cs | Library availability, empty states, folder actions, and breadcrumbs |
| Screenbox/…/FolderViewPage.xaml.cs and Screenbox.Core/…/FolderViewPageViewModel.cs | Shared local and network folder browsing model |
| Screenbox/…/NetworkPage.xaml.cs and Screenbox.Core/…/NetworkPageViewModel.cs | Network root, server breadcrumbs, and empty network state |
| Screenbox/…/PlayerPage.xaml.cs and Screenbox.Core/…/PlayerPageViewModel.cs | Player modes, current media, playback state, and shell coordination |
Screenbox/Pages/PlayQueuePage.xaml and Screenbox.Core/…/PlayQueuePageViewModel.cs | Queue entry points and the relationship between user input and queue state |
| Screenbox/…/SearchResultPage.xaml.cs and Screenbox.Core/…/SearchResultPageViewModel.cs | Search result groups, progressive display, and detail or playback routes |
| Screenbox/…/SettingsPage.xaml.cs and Screenbox.Core/…/SettingsPageViewModel.cs | Settings lifecycle, shared settings contexts, library refresh, and relaunch rules |