Consolonia.ManagedWindows 11.3.9

dotnet add package Consolonia.ManagedWindows --version 11.3.9
                    
NuGet\Install-Package Consolonia.ManagedWindows -Version 11.3.9
                    
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="Consolonia.ManagedWindows" Version="11.3.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Consolonia.ManagedWindows" Version="11.3.9" />
                    
Directory.Packages.props
<PackageReference Include="Consolonia.ManagedWindows" />
                    
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 Consolonia.ManagedWindows --version 11.3.9
                    
#r "nuget: Consolonia.ManagedWindows, 11.3.9"
                    
#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 Consolonia.ManagedWindows@11.3.9
                    
#: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=Consolonia.ManagedWindows&version=11.3.9
                    
Install as a Cake Addin
#tool nuget:?package=Consolonia.ManagedWindows&version=11.3.9
                    
Install as a Cake Tool

Consolonia.ManagedWindows

Managed windows and storage integration for Consolonia/Avalonia apps running in the console.

This module provides:

  • File and folder pickers implemented as managed windows (open, save, pick folder).
  • An IStorageProvider implementation that plugs into Avalonia (ConsoloniaStorageProvider).
  • Simple wrappers for system files/folders (SystemStorageFile, SystemStorageFolder).
  • Theme resources for managed windows (Modern and TurboVision) with auto‑inclusion via AutoManagedWindowStyles.

Getting started

  1. Enable the Consolonia storage provider in your app startup:
using Avalonia;
using Consolonia.ManagedWindows.Storage;

public static class Program
{
    public static void Main(string[] args)
    {
        BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
    }

    public static AppBuilder BuildAvaloniaApp() =>
        AppBuilder.Configure<App>()
                  .UsePlatformDetect()
                  .UseConsoloniaStorage(); // <= enables Consolonia storage dialogs
}
  1. Include Managed Windows styles (Modern/TurboVision). The easiest way is to auto‑include styles based on your Consolonia theme family:

<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:themes="clr-namespace:Consolonia.Themes;assembly=Consolonia.ManagedWindows">
  <Application.Styles>
    <themes:AutoManagedWindowStyles/>
  </Application.Styles>
  
  
</Application>

Alternatively, include styles explicitly:


<StyleInclude Source="avares://Consolonia.ManagedWindows/Themes/Base.axaml" />


<StyleInclude Source="avares://Consolonia.ManagedWindows/Themes/TurboVision/TurboVision.axaml" />

Using the pickers (Avalonia IStorageProvider)

All standard Avalonia storage APIs are supported through TopLevel.StorageProvider.

Open files:

var topLevel = TopLevel.GetTopLevel(this)!;
var files = await topLevel.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{
    Title = "Open files",
    AllowMultiple = true,
    FileTypeFilter = new[]
    {
        new FilePickerFileType("Text") { Patterns = new[] { "*.txt", "*.md" } }
    }
});

Save a file:

var topLevel = TopLevel.GetTopLevel(this)!;
var file = await topLevel.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
{
    Title = "Save as",
    SuggestedFileName = "document.txt"
});

if (file is not null)
{
    await using var stream = await file.OpenWriteAsync();
    // write your content
}

Pick a folder:

var topLevel = TopLevel.GetTopLevel(this)!;
var folders = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{
    Title = "Choose a folder",
    AllowMultiple = false
});

You can also resolve paths directly through the provider:

var file = await topLevel.StorageProvider.TryGetFileFromPathAsync(new Uri("file:///path/to/file.txt"));
var folder = await topLevel.StorageProvider.TryGetFolderFromPathAsync(new Uri("file:///path/to/folder"));

What’s inside

  • Storage/StorageStartupExtensions.csAppBuilder.UseConsoloniaStorage() extension.
  • Storage/ConsoloniaStorageProviderFactory.cs – wires IStorageProvider for a TopLevel.
  • Storage/ConsoloniaStorageProvider.cs – implements IStorageProvider using managed dialogs.
  • Controls/FileOpenPicker.*, FileSavePicker.*, FolderPicker.* – managed window dialogs.
  • Controls/SystemStorageFile.cs, SystemStorageFolder.cs – system I/O wrappers.
  • AutoManagedWindowStyles and resources in Themes/ – styles for managed windows.

Samples

See src/Consolonia.Gallery for examples of using pickers in a running Consolonia app.

Dependencies

  • Avalonia 11+
  • Iciclecreek.Avalonia.WindowManager (for managed windows)
  • Consolonia.Core / Consolonia.Themes

License

This project is part of the Consolonia repository and is licensed under the repository’s root license.

Product 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 was computed.  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. 
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
11.3.9 100 3/22/2026
11.3.9-beta.2378 32 3/22/2026