Application shell and user experience
Screenbox is a Windows media player with one application shell for browsing media, finding content, managing playback, and opening settings. The shell turns Windows launch events into a window with shared navigation and a content area, while media pages provide the workflows inside that frame.
Windows startup
Activation paths
The application starts through the Windows app model. A normal launch creates the shell and opens the main page. A file launch creates the same shell when needed, then sends the selected files to the playback queue. The startup boundary also chooses whether a file request uses a new application instance or an existing one (Screenbox/Program.cs• L16-59, Screenbox/App.xaml.cs• L207-236).
Startup prepares shared services and the media engine before normal use. Database setup runs in the background after launch, so the shell can appear while stored library data becomes ready (Screenbox/App.xaml.cs• L46-78, Screenbox/App.xaml.cs• L243-261, Screenbox/App.xaml.cs• L317-328).
This diagram shows how Windows activation becomes either a browsing session or a playback request.
flowchart TD
A[Windows activation] --> B{Activation type}
B -->|Normal launch| C[Select application instance]
B -->|File launch| C
C --> D[Create or reuse application]
D --> E[Create root frame]
E --> F[Open main shell]
B -->|File launch| G[Send selected files to queue]
F --> G
References: Screenbox/Program.cs• L16-59 Screenbox/App.xaml.cs• L207-236 Screenbox/App.xaml.cs• L243-261
Window preparation
The root frame is the window-level navigation context. It is created once and reused across activation paths. Its theme and text direction follow user settings and system language, while Xbox receives a focus model suited to remote or gamepad input (Screenbox/App.xaml.cs• L330-364).
The application reports serious failures through the shell instead of leaving the user without context. It also flushes telemetry during suspension so the next session can start from a known state (Screenbox/App.xaml.cs• L80-126, Screenbox/App.xaml.cs• L287-315).
References: Screenbox/App.xaml.cs• L46-78 Screenbox/App.xaml.cs• L80-126 Screenbox/App.xaml.cs• L287-364
Shell composition
Shared window frame
The main page is the application shell. It combines the title bar, the primary navigation pane, a content frame for the current workflow, and a player frame that can appear above the content. Notifications and critical-error views share this boundary so feedback remains visible across pages (Screenbox/Pages/MainPage.xaml#L59-L76, Screenbox/Pages/MainPage.xaml#L229-L264).
The shell changes its layout as the window changes size. Expanded, compact, and minimal navigation states adjust the title bar, pane, and page margins rather than changing the user's current workflow (Screenbox/Pages/MainPage.xaml#L292-L429).
References: Screenbox/…/MainPage.xaml• L59-76 Screenbox/…/MainPage.xaml• L229-264 Screenbox/…/MainPage.xaml• L292-429
Shared presentation resources
Application resources provide the common visual language for pages. They define theme-aware controls, commands, converters, text sizes, spacing, grid proportions, and shared animation resources (Screenbox/App.xaml#L13-L117). Reusable controls and presentation rules are described in UI controls and theming.
References: Screenbox/App.xaml• L13-117
Primary navigation
Top-level destinations
The primary navigation gives users stable entry points for the main media tasks: Home, music, videos, network media, the play queue, playlists, and settings. The shell maps each destination to a page and avoids adding a new page when the selected destination is already active (Screenbox/Pages/MainPage.xaml#L103-L201, Screenbox/…/MainPage.xaml.cs• L39-55, Screenbox/…/MainPage.xaml.cs• L139-163).
Search is part of this navigation surface. Users can enter a query, choose a suggestion, or submit a search that opens the matching content workflow. The pane also accepts dropped media and passes it to the shell's media commands (Screenbox/Pages/MainPage.xaml#L203-L227, Screenbox/…/MainPage.xaml.cs• L306-373).
References: Screenbox/…/MainPage.xaml• L103-227 Screenbox/…/MainPage.xaml.cs• L39-55 Screenbox/…/MainPage.xaml.cs• L139-163 Screenbox/…/MainPage.xaml.cs• L306-373
Back navigation
Back navigation follows the visible layer of the experience. It first closes an open navigation pane, then minimizes or leaves the player when it is visible, then delegates to a nested page, and finally uses the shell content frame. This keeps nested library views and the player from competing with the main page for the same back action (Screenbox/…/MainPage.xaml.cs• L179-225).
The shell keeps the navigation selection aligned with the active page. This matters when a detail or search page is opened from another workflow because the selected top-level destination still explains where the user is (Screenbox/…/MainPage.xaml.cs• L227-259). Detailed page roles and nested navigation are covered by Page navigation and media views.
References: Screenbox/…/MainPage.xaml.cs• L179-259
User-facing media workflows
Home workflow
Home is the low-friction entry point for media. It shows recent items when they exist and offers one open action that can lead to files, folders, or a URL. When no recent media exists, the page changes to a welcome state that guides the first open action (Screenbox/Pages/HomePage.xaml#L91-L148, Screenbox/Pages/HomePage.xaml#L197-L243).
The same page supports selection-based actions for recent items. Users can select media as a group and send it to playback or remove it without leaving the Home workflow (Screenbox/Pages/HomePage.xaml#L149-L195, Screenbox/Pages/HomePage.xaml#L269-L296).
References: Screenbox/…/HomePage.xaml• L149-195 Screenbox/…/HomePage.xaml• L269-296
Library workflows
Music and video are separate library areas because users browse them in different ways. Music offers songs, albums, and artists. Video offers folders and an all-videos view, with breadcrumbs for folder context. Both areas provide an empty state that points users to adding a local folder when no content is available (Screenbox/Pages/MusicPage.xaml#L22-L140, Screenbox/Pages/VideosPage.xaml#L22-L150).
These areas use nested content navigation. The outer destination stays selected while the inner view changes, so a user can move between a library category and its details without losing the larger media context (Screenbox/…/MusicPage.xaml.cs• L20-117, Screenbox/…/VideosPage.xaml.cs• L20-124).
References: Screenbox/…/MusicPage.xaml.cs• L20-117 Screenbox/…/VideosPage.xaml.cs• L20-124
Playback workflow
The player is an overlay workflow owned by the shell. It can cover the browsing pages for an immersive view, show a smaller player state, or return the user to the prior page. The player surface changes its presentation for video, audio, and visualizer content while keeping the media identity and core controls available (Screenbox/Pages/MainPage.xaml#L229-L231, Screenbox/Pages/PlayerPage.xaml#L99-L119, Screenbox/Pages/PlayerPage.xaml#L670-L801, Screenbox/Pages/PlayerPage.xaml#L889-L903).
The play queue is available from both the main navigation and the player title bar. This gives users a direct path from browsing to queue management without requiring them to leave playback (Screenbox/Pages/MainPage.xaml#L151-L180, Screenbox/Pages/PlayerPage.xaml#L541-L585). Playback internals are outside this page; the shell only defines where the workflow appears and how users return from it.
References: Screenbox/…/MainPage.xaml• L229-231 Screenbox/…/MainPage.xaml• L151-180 Screenbox/…/PlayerPage.xaml• L541-585 Screenbox/…/PlayerPage.xaml• L670-801
Related pages
The shell provides the shared frame and user journey. Read Page navigation and media views for the responsibilities of individual pages and their nested view flows. Read UI controls and theming for the reusable presentation layer that gives those pages a consistent Windows experience.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the activation routes aligned with the shell's root-frame setup. File activation must still reach the queue even when the window already has content.
- Keep each primary navigation tag mapped to one destination. A mismatch can leave the selected item out of sync with the visible page.
- Keep nested music and video pages exposed through their parent destination so back navigation and selection state remain coherent.
- Keep player visibility and back handling coordinated. A visible player must remain dismissible without discarding the browsing page.
- Keep empty-state actions aligned with the supported ways to add media. Home, music, and video pages must not guide users to an unavailable entry path.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A file activation skips root-frame initialization | The file request has no shell or visible playback context | Initialize or reuse the root frame before sending files to the queue |
| A navigation tag has no matching page type | A selection can change without opening the intended destination | Maintain the shell's tag-to-page mapping with each navigation item |
| Player visibility is handled without the shell back order | Back can close the wrong layer or leave the player stranded | Resolve pane, player, nested content, and shell history in that order |
| A library has no content but its content frame remains active | Users see an empty workflow without a clear next action | Use the library empty state and its folder-add action when content is absent |
| A nested page is opened without restoring its parent selection | The visible page and navigation context disagree | Update the parent navigation selection after nested navigation |
Key files
| File | Why to read it |
|---|---|
| Screenbox/Program.cs | Shows Windows instance selection and activation redirection. |
| Screenbox/App.xaml.cs | Shows startup, root-frame creation, file activation, suspension, and service composition. |
Screenbox/App.xaml | Shows application-wide resources and theme-aware presentation defaults. |
Screenbox/Pages/MainPage.xaml | Shows the shell layout, top-level navigation, search surface, player overlay, and visual states. |
| Screenbox/…/MainPage.xaml.cs | Shows destination mapping, back behavior, nested frame coordination, and input handling. |
Screenbox/Pages/HomePage.xaml | Shows the recent-media and first-use workflow. |
Screenbox/Pages/MusicPage.xaml | Shows the music library's category navigation and empty state. |
Screenbox/Pages/VideosPage.xaml | Shows the video library's folder navigation, breadcrumbs, and empty state. |
Screenbox/Pages/PlayerPage.xaml | Shows how playback occupies the shell across video, audio, and compact views. |