BSGameLib.UI 1.0.4-preview

This is a prerelease version of BSGameLib.UI.
dotnet add package BSGameLib.UI --version 1.0.4-preview
                    
NuGet\Install-Package BSGameLib.UI -Version 1.0.4-preview
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BSGameLib.UI" Version="1.0.4-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BSGameLib.UI" Version="1.0.4-preview" />
                    
Directory.Packages.props
<PackageReference Include="BSGameLib.UI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BSGameLib.UI --version 1.0.4-preview
                    
#r "nuget: BSGameLib.UI, 1.0.4-preview"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BSGameLib.UI@1.0.4-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BSGameLib.UI&version=1.0.4-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BSGameLib.UI&version=1.0.4-preview&prerelease
                    
Install as a Cake Tool

BSGameLib.UI

The UI layer for BSGameLib.Game: views written in XML (.view.xml, with a schema) or built in C#, bound to view-models.

  • View-models with property-change notification and commands; bindings from view to view-model.
  • Layouts (stack, dock, grid, panel) and controls: buttons, check boxes, combo boxes, radio buttons, sliders, text and password boxes, repeaters, labels, images and progress bars.
  • Styles per state (normal, hover, clicked), gradients, shadows, nine-patch textures and themes.
  • A view stack, non-modal panels, toasts, tooltips and a UI scale.
  • Views sent by a server, loaded with limits on what they can contain.
  • Two fonts built in: Voltaire and Boogaloo.
using BSGameLib.Game;
using BSGameLib.UI;
using BSGameLib.UI.Builder;
using Microsoft.Extensions.DependencyInjection;

public class MyGame : Game
{
  protected override void Configure(IServiceCollection services) => services.AddUI();

  protected override void Initialize()
  {
    GetService<IViewManager>().SetView<MenuViewModel>();
    base.Initialize();
  }
}

public class MenuViewModel : ViewModel
{
  private string _playerName = string.Empty;

  public MenuViewModel(IViewManager viewManager) : base(viewManager)
  {
    PlayCommand = new DelegateCommand(() => { /* start the game */ });
  }

  public ICommand PlayCommand { get; }

  public string PlayerName
  {
    get => _playerName;
    set => Set(ref _playerName, value);
  }

  protected override void BuildView(IViewBuilder builder) =>
    builder.PopulateFromFile(Path.Combine(AppContext.BaseDirectory, "Views", "Menu.view.xml"));
}

Views/Menu.view.xml, copied to the output with <Content Include="Views\**\*" CopyToOutputDirectory="PreserveNewest" />:

<View>
  <StackLayout Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" VerticalSpacing="12">
    <TextBox Id="name" Size="{240,30}" Text="{Binding PlayerName}" />
    <Button Id="play" Text="Play" Size="{240,40}" Command="PlayCommand" />
  </StackLayout>
</View>

Documentation: https://docs.burningstormstudios.com/

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4-preview 54 11/9/2026