Home

Awesome

Build Status NuGet MyGet

Movere

Movere

Movere is an implementation of managed dialogs for Avalonia. Currently there are message dialogs, as well as open and save file dialogs, and a print dialog (based on System.Drawing.Printing) is WIP.

Getting Started

Registering file dialogs with Avalonia

To use Avalonia system dialog APIs, it's possible to simply register Movere dialogs with AppBuilder:

  1. Import Movere namespace:
using Movere;
  1. Add UseMovere to AppBuilder configuration. Example:
AppBuilder.Configure<App>()
    .UsePlatformDetect()
    .UseMovere();
  1. Then use Avalonia system dialog APIs. Example:
var dialog = new OpenFileDialog();
var result = await dialog.ShowAsync(parent);

Using dialog services

To simply use the dialogs (this example is for message dialogs, but it's similar for others):

  1. Create a dialog service for Window (owner):
var messageDialogService = new MessageDialogService(owner);
  1. Pass the service to View Model:
window.DataContext = new ViewModel(messageDialogService);
  1. Show dialog from View Model when you need to:
private Task ShowInfoAsync() =>
    _messageDialogService.ShowMessageDialogAsync(
        new MessageDialogOptions(
            DialogIcon.Info,
            "Message Dialog",
            "Some info",
            DialogResultSet.OK));

Available icons are:

To add your own icon, just create an instance of DialogIcon and pass the resource string, e.g avares://My.App/Resources/Icons/MyIcon.png.

Dialog results are extensible as well, and support localization.

Roadmap

Credits

Icons

flaticon.com

The project logo is from linea.io.