Casasoft.Avalonia.Controls 1.0.0

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

Casasoft.Avalonia.Controls

Porting su AvaloniaUI dei controlli custom del pacchetto NuGet WPF-only Casasoft.Xaml.Controls: FileTextBox, FileTextBoxLabel, NumericUpDown, ImageViewer, PangoTextEditor.

Questo progetto non referenzia altri progetti: dipende solo da Avalonia e da Magick.NET-Q16-AnyCPU (necessario solo per ImageViewer.SetImage(MagickImage)). È quindi riutilizzabile in qualsiasi applicazione Avalonia, indipendentemente dal progetto originario in cui è nato Casasoft.Xaml.Controls.

Mappa dei controlli

WPF (Casasoft.Xaml.Controls) Avalonia (Casasoft.Avalonia.Controls) Note
FileTextBox FileTextBox Stessa API (Value, OpenFileDialogFilter, OpenFileDialogTitle). Il filtro usa la stessa sintassi WPF ("Descrizione\|*.ext1;*.ext2\|..."), quindi gli attributi XAML esistenti si copiano invariati. Il picker usa IStorageProvider (async) invece di Microsoft.Win32.OpenFileDialog.
FileTextBoxLabel FileTextBoxLabel Aggiunge Caption; inoltra le altre proprietà al FileTextBox interno.
NumericUpDown NumericUpDown Avvolge il controllo nativo Avalonia.Controls.NumericUpDown (decimal) esponendo Value/MinValue come int, per riusare Value="3" MinValue="1" così com'è. Il ContextMenu si attacca direttamente al controllo, senza proprietà dedicate (ContextMenu è già ereditata da Control).
ImageViewer ImageViewer Non esiste più .ToBitmapSource() (era di Magick.NET.SystemWindowsMedia, WPF-only). Sostituito da imageViewer.SetImage(MagickImage), che converte via PNG in-memory. Espone anche Source (Bitmap) diretta e Clear().
PangoTextEditor PangoTextEditor Semplice editor multilinea (Value); il markup Pango è interpretato solo lato engine consumer, non c'è rendering live né nell'originale né qui.

Conversione immagini: prima/dopo

// WPF
image.Source = bm.ToBitmapSource();

// Avalonia
imageViewer.SetImage(bm);

Come referenziarlo

<ItemGroup>
  <ProjectReference Include="..\Casasoft.Avalonia.Controls\Casasoft.Avalonia.Controls.csproj" />
</ItemGroup>

E nel namespace XAML dei form:

xmlns:casasoft="clr-namespace:Casasoft.Avalonia.Controls;assembly=Casasoft.Avalonia.Controls"

(stesso ruolo di xmlns:casasoft="clr-namespace:Casasoft.Xaml.Controls;assembly=Casasoft.Xaml.Controls" nei form WPF che usano il pacchetto originale)

Cosa NON è ancora incluso

  • Nessun equivalente di PortableColorPicker: da scegliere un pacchetto community Avalonia (es. AvaloniaColorPicker) o scriverne uno minimale.
  • Nessun equivalente di XamlAnimatedGif: valutare AvaloniaGif o sostituire con uno spinner nativo (ProgressBar indeterminato).

Requisiti

Dipendenza Versione minima
.NET 10.0
Avalonia 11.2.5
Magick.NET-Q16-AnyCPU ≥ 14.15.0
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.0 126 7/26/2026