StatusBar.Avalonia
0.0.1
dotnet add package StatusBar.Avalonia --version 0.0.1
NuGet\Install-Package StatusBar.Avalonia -Version 0.0.1
<PackageReference Include="StatusBar.Avalonia" Version="0.0.1" />
<PackageVersion Include="StatusBar.Avalonia" Version="0.0.1" />
<PackageReference Include="StatusBar.Avalonia" />
paket add StatusBar.Avalonia --version 0.0.1
#r "nuget: StatusBar.Avalonia, 0.0.1"
#addin nuget:?package=StatusBar.Avalonia&version=0.0.1
#tool nuget:?package=StatusBar.Avalonia&version=0.0.1
StatusBar.Avalonia
A status bar control for AvaloniaUI, inspired by the Visual Studio Code status bar. It features a simple and flexible API.
Features
Embed icons directly in the status text. Refer to the VS Code Icon Reference.
Support for custom content
Built-in context menu for enabling/disabling status bar items
Built-in color themes
Simple click event handling
Temporarily display a status bar item
Getting Started
1. Install via NuGet
Install-Package StatusBar.Avalonia
2. Reference the style in App.axaml
<Application ...
xmlns:status="https://github.com/xiyaowong/StatusBar.Avalonia"
...>
<Application.Styles>
<status:StatusBarTheme/>
</Application.Styles>
</Application>
3. Add the StatusBarContainer
to your layout
<status:StatusBarContainer Name="_StatusBarContainer"/>
4. Create and bind the StatusBarManager
public StatusBarManager StatusBarManager { get; } = new();
...
StatusBarManager.BindContainer(_StatusBarContainer);
5. Create and display a status bar item
var status = StatusBarManager.CreateStatusBarItem("status");
status.Text = "Hello World";
status.Show();
Usage
Embedding icons in text
status.Text = "$(git-branch) master"; // a git branch icon
status.Text = "$(sync~spin) Syncing..."; // a spinning sync icon
Custom content
status.Content = new TextBlock
{
Text = "Hello World",
FontStyle = FontStyle.Italic,
};
Context menu
Enabled by default. To disable it, set the DisableDefaultContextMenu
property of StatusBarContainer
to true
.
The DisabledItems
property on StatusBarContainer
contains the list of disabled items.
Click action
status.Click = () =>
{
// Do something when the status bar item is clicked
};
Temporary messages
// show 'Hello world!' for 3 seconds
status.SetStatusBarMessage("Hello world!", 3000);
// show 'Hello world!' until the action is completed
status.SetStatusBarMessage("Hello world!", async () =>
{
// Do something
});
Theming
Built-in themes
DarkPlus
OneDark
GithubDefault
Set the ColorTheme
property of StatusBarContainer
to apply a theme.
Customizable colors
StatusBarBackground
- the background color of the status barStatusBarForeground
- the foreground color of the status barStatusBarItemHoverBackground
- the background color of the status bar item when hoveredStatusBarItemHoverForeground
- the foreground color of the status bar item when hoveredStatusBarItemActiveBackground
- the background color of the status bar item when active (pressed)
Demo
- See the demo project for more examples.
Resources
License
MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
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 |
---|---|---|
0.0.1 | 121 | 5/22/2025 |