Build with XuiView Markdown

Understand the generated project

A Xui app has one UI written in C# and several small projects that host it. You can change a page once and run the same page in a desktop window, phone emulator, or browser.

This guide describes the maintained starter sources. If your installed template differs, compare its package version with the release caveat in Getting Started.

Find the files you will edit

For an app named FieldNotes, start with these files:

File Responsibility
WelcomePage.cs, CounterPage.cs, AboutPage.cs Shared page content and interaction. Add your pages alongside them.
MainWindow.cs The window title, design-system provider, and navigation destinations.
Application.cs Opens the main window from Start().
Program.cs Builds the host, registers the application and window, and starts the runtime.
Platform.cs Selects a platform runtime and optional emulator/DevTools middleware.
FieldNotes.targets App identity, shared compiler settings, and app dependencies.
Xui.targets Selects runtime references and source exclusions for the chosen host.

The platform projects include the shared .cs files. You do not need to copy a new page into each project or create a platform version of an ordinary button.

Pick the project that launches your app

Run these from the generated app folder; replace FieldNotes if you chose another name:

dotnet run --project FieldNotes.Emulator.csproj
dotnet run --project FieldNotes.Desktop.csproj

The Desktop project selects macOS or Windows from the build host. The Emulator project wraps that desktop runtime with phone emulation. The Browser project uses Blazor WebAssembly. The Mobile project contains the native Android and iOS host setup and requires the corresponding workloads and native toolchains.

An emulator run does not package or execute a native Android or iOS app. Use it to iterate on shared views and phone-sized interactions, then test the native project on the platforms you intend to ship.

Keep application changes shared

Put a new TrailPage.cs beside the other pages, then register its factory in MainWindow. Put shared package references in the app's .targets file. Keep platform bootstrap code and native packaging resources in their host-specific locations.

The source repository uses project references for development. The packed template replaces framework project references with package references; a generated app should not need a checkout of the Xui repository to resolve those libraries.

The starter registers the bundled Inter font source in Platform.cs. Preserve that registration while experimenting with text so the same font can reach each runtime. Adding an image requires both a valid runtime URI and the host's packaging or web-hosting configuration; a file merely sitting beside a .cs file is not automatically a deployed asset.

Next, follow Application, window, and view to trace startup into the first visible page.