Skip to content

xiyaowong/Message.Avalonia

Repository files navigation

Message.Avalonia

NuGet
NuGet

A lightweight and easy-to-use message/notification/toast library for Avalonia UI.

Message.Avalonia.Demo.Desktop_cSzShJDtUN.mp4

Getting Started

Important

The documentation is minimal, but the demo project showcases all available features. This library is designed to be very developer-friendly.

1. Install the NuGet package

Install-Package Message.Avalonia

2. Add the required styles to your App.xaml

<Application ...
             xmlns:msg="https://github.com/xiyaowong/Message.Avalonia"
             ...>

    <Application.Styles>
        <msg:Theme />
    </Application.Styles>
</Application>

3. Add the MessageHost to your UI layout

<Panel>
    <!-- Your main UI content -->
    <msg:MessageHost />
    <msg:MessageHost HostId="Another" Position="BottomCenter" />
</Panel>
  • HostId is optional. If omitted, the default host will be used.
  • You can skip defining MessageHost entirely — a default host will be created automatically if needed.

4. Show messages using MessageManager

MessageManager.Default.ShowInfomationMessage("Hello");

Usage

Override the default styles

Colors:

<!-- Text and icon colors -->
<Color x:Key="MessageInfoColor">
<Color x:Key="MessageSuccessColor">
<Color x:Key="MessageWarningColor">
<Color x:Key="MessageErrorColor">

<!-- Border colors -->
<Color x:Key="MessageInfoBorderColor">
<Color x:Key="MessageSuccessBorderColor">
<Color x:Key="MessageWarningBorderColor">
<Color x:Key="MessageErrorBorderColor">

Icons:

<StreamGeometry x:Key="message_info_icon">
<StreamGeometry x:Key="message_success_icon">
<StreamGeometry x:Key="message_warning_icon">
<StreamGeometry x:Key="message_error_icon">
<StreamGeometry x:Key="message_close_icon">

License

MIT

About

A lightweight and user-friendly notification/toast library for Avalonia UI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors