VOOZH about

URL: https://www.nuget.org/packages/Xcalibur.Extensions.MVVM.V2/

⇱ NuGet Gallery | Xcalibur.Extensions.MVVM.V2 1.0.5




👁 Image
Xcalibur.Extensions.MVVM.V2 1.0.5

dotnet add package Xcalibur.Extensions.MVVM.V2 --version 1.0.5
 
 
NuGet\Install-Package Xcalibur.Extensions.MVVM.V2 -Version 1.0.5
 
 
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="Xcalibur.Extensions.MVVM.V2" Version="1.0.5" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xcalibur.Extensions.MVVM.V2" Version="1.0.5" />
 
Directory.Packages.props
<PackageReference Include="Xcalibur.Extensions.MVVM.V2" />
 
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 Xcalibur.Extensions.MVVM.V2 --version 1.0.5
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Xcalibur.Extensions.MVVM.V2, 1.0.5"
 
 
#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 Xcalibur.Extensions.MVVM.V2@1.0.5
 
 
#: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=Xcalibur.Extensions.MVVM.V2&version=1.0.5
 
Install as a Cake Addin
#tool nuget:?package=Xcalibur.Extensions.MVVM.V2&version=1.0.5
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Xcalibur.Extensions.MVVM.V2

👁 .NET Version
👁 NuGet

A comprehensive .NET MVVM extension library providing base models, commands, validation, and property subscription utilities for use in WPF, UWP, Xamarin, and MAUI applications.

Created by: Joshua Arzt | Company: Xcalibur Systems, LLC.

📋 Table of Contents

Features

Base Models

  • ModelBase: Abstract base class implementing INotifyPropertyChanged with unique instance identity (Guid), active state tracking, and property change notification via NotifyOfChange
  • ValidationModelBase: Extends ModelBase with full data annotation–based validation, validation exception tracking, and an ObservableCollection of validation errors

Commands

  • RelayCommand: Synchronous ICommand implementation exposing an Action and optional CanExecute evaluator to the view, with RaiseCanExecuteChanged support
  • RelayCommand<T>: Generic variant of RelayCommand accepting a typed parameter
  • RelayCommandAsync: Asynchronous ICommand implementation wrapping a Func<Task>, with automatic execution-guard to prevent re-entrant invocations and RaiseCanExecuteChanged support
  • RelayCommandAsync<T>: Generic variant of RelayCommandAsync accepting a typed parameter

Validation

  • ValidationHelper: Static helper providing key-input validation (numeric-only, decimal support) and data annotation–based model validation utilities
  • ValidationModelBase: Integrates ValidationHelper to expose structured ValidationExceptionItem collections directly on the model

Subscriptions

  • SubscriptionItem / ISubscriptionItem: Represents a named property subscription, linking a callback action to a specific property's change event
  • SubscriptionExtensions: Fluent extension methods (Subscribe, ClearSubscriptions) for registering and removing strongly-typed property subscriptions using lambda expressions

Extensions

  • ModelBaseExtensions: Extension methods that augment ModelBase with additional convenience functionality
  • SubscriptionExtensions: Strongly-typed, expression-based subscribe/unsubscribe extensions targeting any ISubscribe implementation

Installation

NuGet Package Manager

Install-Package Xcalibur.Extensions.MVVM.V2

.NET CLI

dotnet add package Xcalibur.Extensions.MVVM.V2

Package Reference

<PackageReference Include="Xcalibur.Extensions.MVVM.V2" Version="1.0.5" />

Requirements

  • .NET 8 or .NET 10
  • Xcalibur.Extensions.V2 (included as dependency)

Usage

ModelBase

Inherit from ModelBase to get INotifyPropertyChanged, a unique Guid identifier, IsActive tracking, and property subscription support out of the box.

using Xcalibur.Extensions.MVVM.V2.Models;

public class PersonViewModel : ModelBase
{
 private string _name;

 public string Name
 {
 get => _name;
 set => NotifyOfChange(value, ref _name);
 }
}

ValidationModelBase

Inherit from ValidationModelBase to add data annotation–based validation on top of ModelBase.

using System.ComponentModel.DataAnnotations;
using Xcalibur.Extensions.MVVM.V2.Models;

public class LoginViewModel : ValidationModelBase
{
 private string _username;

 [Required(ErrorMessage = "Username is required.")]
 public string Username
 {
 get => _username;
 set => NotifyOfChange(value, ref _username);
 }

 public bool TryLogin()
 {
 Validate();
 return IsValid;
 }
}

RelayCommand

using Xcalibur.Extensions.MVVM.V2.Commands;

public class MyViewModel : ModelBase
{
 public RelayCommand SaveCommand { get; }

 public MyViewModel()
 {
 SaveCommand = new RelayCommand(OnSave, CanSave);
 }

 private bool CanSave() => true;
 private void OnSave() { /* save logic */ }
}

RelayCommand<T>

using Xcalibur.Extensions.MVVM.V2.Commands;

public class MyViewModel : ModelBase
{
 public RelayCommand<string> GreetCommand { get; }

 public MyViewModel()
 {
 GreetCommand = new RelayCommand<string>(name => Console.WriteLine($"Hello, {name}!"));
 }
}

RelayCommandAsync

using Xcalibur.Extensions.MVVM.V2.Commands;

public class MyViewModel : ModelBase
{
 public RelayCommandAsync LoadCommand { get; }

 public MyViewModel()
 {
 LoadCommand = new RelayCommandAsync(OnLoadAsync);
 }

 private async Task OnLoadAsync()
 {
 await Task.Delay(500); // simulate async work
 }
}

RelayCommandAsync<T>

using Xcalibur.Extensions.MVVM.V2.Commands;

public class MyViewModel : ModelBase
{
 public RelayCommandAsync<int> FetchCommand { get; }

 public MyViewModel()
 {
 FetchCommand = new RelayCommandAsync<int>(async id =>
 {
 var result = await FetchDataAsync(id);
 });
 }
}

Property Subscriptions

Subscribe to a specific property's change event using a strongly-typed lambda expression. Subscriptions can be scoped to an owner Guid for easy cleanup.

using Xcalibur.Extensions.MVVM.V2.Extensions;

var vm = new PersonViewModel();

// Subscribe to Name changes
vm.Subscribe(x => x.Name, newValue =>
{
 Console.WriteLine($"Name changed to: {newValue}");
});

// Clear the Name subscription
vm.ClearSubscriptions(x => x.Name);

Validation Helper

using Xcalibur.Extensions.MVVM.V2.Helpers;

// Check if a keycode is numeric-only (e.g., in a PreviewKeyDown handler)
bool isNumeric = ValidationHelper.IsKeyNumericOnly(e.KeyValue);

// Allow decimals as well
bool isNumericWithDecimal = ValidationHelper.IsKeyNumericOnly(e.KeyValue, allowDecimals: true);

API Overview

Class / Interface Namespace Description
ModelBase Models Abstract base with INotifyPropertyChanged, identity, and subscriptions
ValidationModelBase Models Extends ModelBase with data annotation validation
ValidationItem Models Represents a single validation rule
ValidationExceptionItem Models Represents a single validation error
SubscriptionItem Models Represents a single property change subscription
RelayCommand Commands Synchronous ICommand implementation
RelayCommand<T> Commands Generic synchronous ICommand implementation
RelayCommandAsync Commands Asynchronous ICommand implementation
RelayCommandAsync<T> Commands Generic asynchronous ICommand implementation
ValidationHelper Helpers Static validation utility methods
SubscriptionExtensions Extensions Fluent property subscription extension methods
ModelBaseExtensions Extensions Additional ModelBase extension methods
IModelBase Interfaces Core model identity and active-state contract
INotify Interfaces Property notification contract
ISubscribe Interfaces Property subscription contract
ISubscriptionItem Interfaces Subscription item contract
IValidation Interfaces Validation contract
IValidationItem Interfaces Validation rule contract
IValidationExceptionItem Interfaces Validation error contract

Dependencies

Package Purpose
Xcalibur.Extensions.V2 Core C# extension methods used internally (e.g., GetPropertyName, collection extensions)

License

Licensed under the .

Copyright © 2006 – 2026, Xcalibur Systems, LLC. All Rights Reserved.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (1)

Showing the top 1 NuGet packages that depend on Xcalibur.Extensions.MVVM.V2:

Package Downloads
Xcalibur.Weather.Models

A comprehensive .NET library providing data models and DTOs for weather-related applications. Supports multiple weather service providers (OpenMeteo, Geocodio, IpGeo) with strongly-typed models for weather forecasting, air quality monitoring, and astronomical data.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 181 4/30/2026
1.0.4 417 1/3/2026

Added support RelayCommand.