Utilis 0.11.1
dotnet add package Utilis --version 0.11.1
NuGet\Install-Package Utilis -Version 0.11.1
<PackageReference Include="Utilis" Version="0.11.1" />
<PackageVersion Include="Utilis" Version="0.11.1" />
<PackageReference Include="Utilis" />
paket add Utilis --version 0.11.1
#r "nuget: Utilis, 0.11.1"
#:package Utilis@0.11.1
#addin nuget:?package=Utilis&version=0.11.1
#tool nuget:?package=Utilis&version=0.11.1
Utilis
A small MVVM utility library for .NET: property change notifications, in-process messaging, navigation abstractions, Autofac-backed service location, and common extension methods.
Source: github.com/bl0rq/Utilis
Install
dotnet add package Utilis
Target framework: net10.0
View models
Utilis.UI.ViewModel.Base sits on Utilis.ObjectModel.BaseNotifyPropertyChanged and raises INotifyPropertyChanged from SetProperty:
public class MainViewModel : Utilis.UI.ViewModel.Base
{
private string _title = "Hello";
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
}
DelegateCommand implements ICommand and can run work asynchronously through Utilis.Runner.
Messaging
Utilis.Messaging.Bus is a typed in-process bus. Implement IListener<T> for messages that implement IMessage:
public class StatusListener : Utilis.Messaging.IListener<Utilis.Messaging.StatusMessage>
{
public void Receive(Utilis.Messaging.StatusMessage message)
{
// handle status / log messages
}
}
var token = Utilis.Messaging.Bus.Instance.ListenFor(new StatusListener());
Utilis.Messaging.Bus.Instance.Send(new Utilis.Messaging.UserInfoMessage("Ready"));
token.Dispose();
Built-in messages include AppStartedMessage, AppShutdownMessage, AppKillRequestedMessage, UserInfoMessage, and StatusMessage. Utilis.Logger publishes StatusMessage instances on the bus.
Service location
Register types with Autofac using [RegisterService] / [RegisterSingletonService], then wrap the container:
[RegisterSingletonService]
public class Clock : IClock { }
var builder = new Autofac.ContainerBuilder();
builder.RegisterByAttribute(typeof(Clock).Assembly);
Utilis.ServiceLocator.Instance = new Utilis.ServiceLocator(builder.Build());
var clock = Utilis.ServiceLocator.Instance.GetInstance<IClock>();
Navigation
Utilis.UI.Navigation.IService is the platform-agnostic navigation contract (implemented for WPF in Utilis.Win). Views implement IView<TViewModel>; ViewFinder / ViewMapper pair view-model types to view types by scanning assemblies.
Also included
Contract— argument assertions that throwAssertionExceptionRunner— sync/async invocation with optional dispatcher marshalingPair<T1, T2>— two-value notify objectObjectModel.Singleton<T>— lazy singleton helper- Extension methods for strings, collections, dictionaries, types, XML, I/O, time (
TimeSpan.ToPrettyString()), and more
License
MIT
| Product | Versions 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. |
-
net10.0
- Autofac (>= 9.3.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Utilis:
| Package | Downloads |
|---|---|
|
Utilis.Win
Basic utility-level functions, mostly in support of a MVVM pattern for Desktop, Windows Store, and Windows Phone applications. Source can be found at https://github.com/bl0rq/Utilis |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.11.1 | 133 | 9/4/2026 |
| 0.10.3 | 6,958 | 2/27/2024 |
| 0.10.2 | 6,909 | 12/19/2023 |
| 0.10.1 | 6,900 | 12/19/2023 |
| 0.9.0.97 | 8,505 | 3/17/2021 |
| 0.9.0.96 | 7,393 | 11/25/2020 |
| 0.9.0.95 | 7,400 | 11/19/2020 |
| 0.8.1.94 | 7,505 | 3/11/2020 |
| 0.8.1.93 | 7,529 | 11/26/2019 |
| 0.8.1.92 | 7,493 | 11/26/2019 |
| 0.8.1.91 | 7,507 | 11/14/2019 |
| 0.8.1.90 | 7,483 | 11/14/2019 |
| 0.8.1.89 | 7,487 | 11/6/2019 |
| 0.8.1.88 | 7,518 | 8/21/2019 |
| 0.8.1.83 | 7,596 | 4/3/2019 |
| 0.8.1.82 | 7,729 | 11/6/2018 |
| 0.8.1.81 | 7,715 | 11/6/2018 |
| 0.8.1.80 | 7,782 | 10/10/2018 |
| 0.8.1.79 | 8,090 | 11/30/2017 |
| 0.8.1.78 | 8,041 | 11/16/2017 |