MainView Layout and Composition
Written By launchbox
Last updated About 1 month ago
MainView.xaml is the top-level layout file for a LaunchBox Desktop theme.
It controls the main LaunchBox window itself and decides where the major interface regions appear:
SideBarView.xaml ContentBackgroundView.xaml BoxesContentView.xaml or ListContentView.xaml GameDetailsView.xaml or PlatformFiltersDetailsView.xaml WorkingView.xamlIf you want to make a LaunchBox theme feel structurally different, MainView.xaml is usually the first file to study.
What MainView Controls
MainView.xaml controls the outer shell of LaunchBox:
A simplified layout looks like this:
MainView.xaml Top Bar ContentBackgroundView SideBarView BoxesContentView or ListContentView GameDetailsView or PlatformFiltersDetailsView WorkingViewMain Layout Grid
The default MainView.xaml uses a main Grid with five columns:
Sidebar Sidebar splitter Main content Game details splitter Game detailsThe sidebar and game details widths are bound to LaunchBox settings through the main view model:
Width="{Binding SideBarWidth, Mode=TwoWay}" Width="{Binding GameDetailsWidth, Mode=TwoWay}"The splitters use related width and visibility bindings:
SideBarGridSplitterWidth GameDetailsGridSplitterWidth SideBarVisibility GameDetailsVisibilityThis allows LaunchBox to show, hide, and resize those areas based on user settings.
Sidebar Region
The sidebar region is hosted with:
<ContentControl x:Name="SideBarViewModel" />The name is important. LaunchBox uses Caliburn.Micro conventions to connect SideBarViewModel to SideBarView.xaml.
Theme developers can move this control, restyle its surrounding area, or change how much space the sidebar gets. The actual sidebar contents are controlled by SideBarView.xaml.
Main Content Region
The main content area is hosted with a transition presenter:
<transitions:TransitionPresenter TransitionSelector="{Binding ContentTransitionSelector}" Content="{Binding ContentView}" />ContentView is usually one of the main browsing views:
BoxesContentView.xaml ListContentView.xamlThe active content view changes when the user switches between image/grid view and list view.
Background Region
The background layer is loaded behind the rest of the main interface:
<transitions:TransitionPresenter TransitionSelector="{Binding ContentBackgroundTransitionSelector}" Content="{Binding ContentBackgroundView}" />This hosts ContentBackgroundView.xaml.
The default theme also places a fade rectangle over the background. Its opacity is bound through BackgroundFadeBrush, allowing LaunchBox visual settings to affect how strongly the background is faded.
Game Details Region
The game details area is hosted with:
<transitions:TransitionPresenter TransitionSelector="{Binding GameDetailsTransitionSelector}" Content="{Binding GameDetailsView}" />This region can show:
GameDetailsView.xaml PlatformFiltersDetailsView.xamlGameDetailsVisibility, GameDetailsWidth, and GameDetailsMinWidth control whether the details panel is visible and how much room it uses.
Working Overlay
The working overlay is hosted at the end of the layout:
<ContentControl x:Name="WorkingViewModel" />This loads WorkingView.xaml.
Because it spans the main grid, it can appear above the rest of the interface during long-running operations, downloads, imports, or progress states.
Top Bar
The default MainView.xaml includes a custom top bar instead of using the normal Windows title bar.
Common top bar controls include:
MenuDropDown ToolsDropDown ViewDropDown ArrangeByDropDown ImageGroupDropDown BadgesDropDown OpenAchievementProfile License Minimize Maximize Restore CloseThese button names connect to methods on MainViewModel. For example:
ToolsDropDown - opens the Tools menu ViewDropDown - opens the View menu ImageGroupDropDown - opens the Image Group menu BadgesDropDown - opens the Badges menu Minimize - minimizes LaunchBox Maximize - maximizes LaunchBox Restore - restores the window Close - closes LaunchBoxWhen customizing the top bar, preserve button names for controls that are meant to trigger LaunchBox behavior.
Required License UI
MainView.xaml must include the LaunchBox license display.
The default theme includes a button named:
<Button x:Name="License">Inside it, the license text is bound to:
Text="{Binding LicenseText}"Custom themes should keep both:
License button LicenseText bindingYou can restyle or reposition the license UI, but it should not be removed. LaunchBox checks for this required UI when loading a custom MainView.xaml.
Transition Bindings
The default main view uses transition presenters for smooth changes between major regions:
These are provided by LaunchBox. Most themes should keep these bindings unless they are intentionally replacing transition behavior.
Common MainView Bindings
These bindings are especially important in MainView.xaml:
What to Be Careful With
When editing MainView.xaml, be careful with:
Renaming controls that map to view model actions.
Removing
SideBarViewModel,WorkingViewModel, or transition presenters.Removing the
Licensebutton orLicenseTextbinding.Hard-coding sidebar or details widths without preserving user resizing.
Blocking the top bar drag area or window controls.
Moving overlays behind other content unintentionally.
Removing visibility bindings that LaunchBox uses to show and hide regions.
The safest approach is to start from the Default theme, move one region at a time, and restart LaunchBox after each major layout change.
Related Articles
In Short
MainView.xaml is the composition root for a LaunchBox Desktop theme. It defines the main window, top bar, sidebar, content region, background, game details panel, splitters, transitions, and working overlay. Theme developers can heavily customize it, but should preserve the named controls, required license UI, region hosts, and visibility/width bindings that LaunchBox uses to keep the interface functional.