Sanet.MVVM.Views.Avalonia 1.7.12200

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

Sanet.MVVM.Views.Avalonia

Typed Avalonia v12 base view that connects a view model to a UserControl.

Installation

dotnet add package Sanet.MVVM.Views.Avalonia

Minimal usage

using Sanet.MVVM.Views.Avalonia;

public partial class MainView : BaseView<MainViewModel>
{
    public MainView()
    {
        InitializeComponent();
    }

    protected override void OnViewModelSet()
    {
        // Called after ViewModel and DataContext are assigned.
    }
}

The view's XAML can use ordinary bindings because BaseView<TViewModel> assigns the view model to DataContext.

Behavior

  • BaseView<TViewModel> derives from Avalonia UserControl and implements IBaseView<TViewModel>.
  • Setting the ViewModel property stores the value, assigns it to DataContext, and calls the virtual OnViewModelSet() hook.
  • The explicit IBaseView.ViewModel implementation forwards values to the typed ViewModel property.
  • OnAttachedToVisualTree calls ViewModel?.AttachHandlers().
  • OnDetachedFromVisualTree calls ViewModel?.DetachHandlers().

Notes and limitations

  • The navigation service creates views with Activator.CreateInstance, so a view used for navigation needs a public parameterless constructor.
  • DataContext and the ViewModel property always point at the same instance after assignment.

License

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Sanet.MVVM.Views.Avalonia:

Package Downloads
Sanet.MakaMek.Avalonia

Avalonia UI frontend for MakaMek game

Sanet.MekForge.Avalonia

Avalonia UI frontend for MekForge game

Sanet.MakaMek.MapEditor

Map editor for MakaMek

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.12200 787 11/24/2026
1.7.1216 2,110 11/10/2026
1.7.1215 198 11/7/2026
1.7.1214 2,037 10/10/2026
1.6.1211 3,268 8/3/2026
1.6.1210 933 7/14/2026
1.5.1213 120 10/7/2026
1.5.1203 2,989 5/28/2026
1.5.1200 2,439 4/8/2026
1.4.11380 4,153 10/23/2025
1.3.1137 341 10/22/2025
1.2.1137 566 10/14/2025
1.1.1.1113 6,045 9/30/2024
1.1.1.1105 456 11/14/2023
1.1.0.1105 271 11/14/2023
1.1.0.1103 357 8/13/2023
1.0.11 409 7/9/2023
0.2.1-preview8 567 6/2/2023
0.2.1-preview 323 4/4/2023
0.2.0-preview 329 4/4/2023
Loading failed