VOOZH about

URL: https://www.nuget.org/packages/Ecng.ComponentModel/

⇱ NuGet Gallery | Ecng.ComponentModel 1.0.451




👁 Image
Ecng.ComponentModel 1.0.451

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

Ecng.ComponentModel

MVVM infrastructure, property change notifications, validation attributes, and UI component helpers.

Property Change Notifications

NotifiableObject

Base class implementing INotifyPropertyChanged and INotifyPropertyChanging.

using Ecng.ComponentModel;

public class Person : NotifiableObject
{
 private string _name;

 public string Name
 {
 get => _name;
 set
 {
 if (_name == value) return;

 NotifyChanging(); // Fires PropertyChanging
 _name = value;
 NotifyChanged(); // Fires PropertyChanged
 }
 }
}

// Subscribe to changes
var person = new Person();
person.PropertyChanged += (s, e) =>
{
 Console.WriteLine($"{e.PropertyName} changed");
};

ViewModelBase

Extended base class for ViewModels with dispatcher support.

public class MainViewModel : ViewModelBase
{
 private bool _isLoading;

 public bool IsLoading
 {
 get => _isLoading;
 set
 {
 _isLoading = value;
 NotifyChanged();
 }
 }
}

DispatcherNotifiableObject

Notifiable object that marshals property changes to the UI thread.

public class ThreadSafeModel : DispatcherNotifiableObject
{
 // PropertyChanged events automatically dispatched to UI thread
}

Observable Collections

ObservableCollectionEx

Extended ObservableCollection<T> with additional features.

var collection = new ObservableCollectionEx<Item>();

// Add range (fires single notification)
collection.AddRange(items);

// Remove range
collection.RemoveRange(itemsToRemove);

// Reset with new items
collection.Reset(newItems);

DispatcherObservableCollection

Thread-safe observable collection with UI dispatcher support.

var collection = new DispatcherObservableCollection<Item>();

// Safe to modify from any thread
Task.Run(() =>
{
 collection.Add(new Item()); // Automatically dispatched
});

ConvertibleObservableCollection

Observable collection that transforms source items.

var models = new ObservableCollection<PersonModel>();
var viewModels = new ConvertibleObservableCollection<PersonModel, PersonViewModel>(
 models,
 model => new PersonViewModel(model));

// Adding to models automatically adds to viewModels
models.Add(new PersonModel());

Range Types

Range<T>

Generic range with min/max bounds.

var range = new Range<int>(1, 100);

// Check containment
bool contains = range.Contains(50); // true
bool outside = range.Contains(150); // false

// Range properties
int min = range.Min; // 1
int max = range.Max; // 100
int length = range.Length; // 99

// Range operations
var other = new Range<int>(50, 150);
var intersection = range.Intersect(other); // Range(50, 100)
var subRange = range.SubRange(20, 80); // Range(20, 80)

NumericRange

Specialized numeric range with additional operations.

var range = new NumericRange<decimal>(0, 100);

// Percentage calculations, clamping, etc.

Validation Attributes

Numeric Validation

public class Settings
{
 [IntValidation(Min = 1, Max = 100)]
 public int Count { get; set; }

 [DoubleValidation(Min = 0.0, Max = 1.0)]
 public double Factor { get; set; }

 [DecimalValidation(Min = 0)]
 public decimal Price { get; set; }

 [LongValidation(Min = 0, Max = 1000000)]
 public long Volume { get; set; }
}

TimeSpan Validation

[TimeSpanValidation(Min = "00:00:01", Max = "24:00:00")]
public TimeSpan Timeout { get; set; }

Price Validation

[PriceValidation(Min = 0)]
public Price StockPrice { get; set; }

Price Type

Financial price with type information.

var price = new Price(100.50m, PriceTypes.Limit);

// Price types
PriceTypes.Limit // Limit price
PriceTypes.Market // Market price
PriceTypes.Percent // Percentage

Attributes

Step Attribute

Define increment step for numeric properties.

[Step(0.01)]
public decimal Price { get; set; }

[Step(1)]
public int Quantity { get; set; }

Icon Attributes

[Icon("path/to/icon.png")]
public class MyCommand { }

[VectorIcon("fas fa-home")] // Font Awesome style
public class HomeCommand { }

Doc Attribute

Link to documentation.

[Doc("https://docs.example.com/my-feature")]
public class MyFeature { }

BasicSetting Attribute

Mark property as a basic (commonly used) setting.

[BasicSetting]
public string ApiKey { get; set; }

Server Credentials

Manage server connection credentials securely.

var credentials = new ServerCredentials
{
 Email = "user@example.com",
 Password = "secret".Secure(), // SecureString
 Token = "api-token".Secure()
};

// Check if configured
bool isConfigured = credentials.IsConfigured;

Process Singleton

Ensure only one instance of an application runs.

using var singleton = new ProcessSingleton("MyApp");

if (!singleton.TryAcquire())
{
 Console.WriteLine("Another instance is already running");
 return;
}

// Application continues...

Dispatcher

Abstract UI thread dispatcher.

public interface IDispatcher
{
 void Invoke(Action action);
 Task InvokeAsync(Action action);
 void BeginInvoke(Action action);
}

// Check if on UI thread
if (!dispatcher.CheckAccess())
{
 dispatcher.Invoke(() => UpdateUI());
}

Channel Executor

Process items from a channel with controlled concurrency.

var executor = new ChannelExecutor<WorkItem>(
 processItem: async item =>
 {
 await ProcessAsync(item);
 },
 maxConcurrency: 4);

// Add work
executor.Enqueue(new WorkItem());

// Graceful shutdown
await executor.StopAsync();

Statistics

Track simple statistics.

var stat = new Stat("ProcessedItems");

stat.Increment();
stat.Add(5);

Console.WriteLine($"Total: {stat.Value}");

Periodic Action Planner

Schedule recurring actions.

var planner = new PeriodicActionPlanner();

planner.Schedule(
 TimeSpan.FromMinutes(5),
 async () => await RefreshDataAsync());

// Stop scheduling
planner.Cancel();

NuGet

Install-Package Ecng.ComponentModel
Product Versions Compatible and additional computed target framework versions.
.NET net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  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 (5)

Showing the top 5 NuGet packages that depend on Ecng.ComponentModel:

Package Downloads
StockSharp.Localization

Localization components. More info on web site https://stocksharp.com/store/

Ecng.Net

Ecng system framework

Ecng.Compilation

Ecng system framework

Ecng.Data

Ecng system framework

Ecng.Logging

Ecng system framework

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Ecng.ComponentModel:

Repository Stars
StockSharp/StockSharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
Version Downloads Last Updated
1.0.451 0 6/18/2026
1.0.450 191 6/17/2026
1.0.449 677 6/14/2026
1.0.448 534 6/12/2026
1.0.447 557 6/9/2026
1.0.446 683 6/8/2026
1.0.445 779 6/2/2026
1.0.444 1,098 5/31/2026
1.0.443 1,236 5/15/2026
1.0.442 557 5/14/2026
1.0.441 836 5/6/2026
1.0.440 657 5/3/2026
1.0.439 636 4/30/2026
1.0.438 1,103 4/14/2026
1.0.437 2,764 3/17/2026
1.0.436 546 3/17/2026
1.0.435 1,200 3/15/2026
1.0.434 545 3/15/2026
1.0.433 1,094 3/10/2026
1.0.432 1,731 3/3/2026
Loading failed

ComponentModel: add notification helpers to NotifiableObject
ComponentModel: add MVVM source generator and messaging