![]() |
VOOZH | about |
dotnet add package Xcalibur.Extensions.MVVM.V2 --version 1.0.5
NuGet\Install-Package Xcalibur.Extensions.MVVM.V2 -Version 1.0.5
<PackageReference Include="Xcalibur.Extensions.MVVM.V2" Version="1.0.5" />
<PackageVersion Include="Xcalibur.Extensions.MVVM.V2" Version="1.0.5" />Directory.Packages.props
<PackageReference Include="Xcalibur.Extensions.MVVM.V2" />Project file
paket add Xcalibur.Extensions.MVVM.V2 --version 1.0.5
#r "nuget: Xcalibur.Extensions.MVVM.V2, 1.0.5"
#:package Xcalibur.Extensions.MVVM.V2@1.0.5
#addin nuget:?package=Xcalibur.Extensions.MVVM.V2&version=1.0.5Install as a Cake Addin
#tool nuget:?package=Xcalibur.Extensions.MVVM.V2&version=1.0.5Install as a Cake Tool
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.
INotifyPropertyChanged with unique instance identity (Guid), active state tracking, and property change notification via NotifyOfChangeModelBase with full data annotation–based validation, validation exception tracking, and an ObservableCollection of validation errorsICommand implementation exposing an Action and optional CanExecute evaluator to the view, with RaiseCanExecuteChanged supportRelayCommand accepting a typed parameterICommand implementation wrapping a Func<Task>, with automatic execution-guard to prevent re-entrant invocations and RaiseCanExecuteChanged supportRelayCommandAsync accepting a typed parameterValidationHelper to expose structured ValidationExceptionItem collections directly on the modelSubscribe, ClearSubscriptions) for registering and removing strongly-typed property subscriptions using lambda expressionsModelBase with additional convenience functionalityISubscribe implementationInstall-Package Xcalibur.Extensions.MVVM.V2
dotnet add package Xcalibur.Extensions.MVVM.V2
<PackageReference Include="Xcalibur.Extensions.MVVM.V2" Version="1.0.5" />
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);
}
}
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;
}
}
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 */ }
}
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}!"));
}
}
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
}
}
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);
});
}
}
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);
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);
| 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 |
| Package | Purpose |
|---|---|
| Xcalibur.Extensions.V2 | Core C# extension methods used internally (e.g., GetPropertyName, collection extensions) |
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. |
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. |
This package is not used by any popular GitHub repositories.
Added support RelayCommand.