diff --git a/README.md b/README.md index 3429e89..e9c59c8 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ MVVMFluent is a lightweight, source-only .NET library designed to simplify the M ## Features - Fluent Property Setters: Easily chain property setters with `Changed`, `Changing`, command reevaluation, and property change notifications. -- Fluent Command Setup: Define commands with `Do` methods and conditional execution via `If`. -- Generic `Command`: Define commands with parameterized actions using a strongly-typed approach. -- Implements `ICommand`: Both `Command` and `Command` implement the `ICommand` interface, enabling full compatibility with WPF and other MVVM frameworks. +- Fluent FluentCommand Setup: Define commands with `Do` methods and conditional execution via `If`. +- Generic `FluentCommand`: Define commands with parameterized actions using a strongly-typed approach. +- Implements `ICommand`: Both `FluentCommand` and `FluentCommand` implement the `ICommand` interface, enabling full compatibility with WPF and other MVVM frameworks. - Source-Only Package: Integrates directly into your project as source code, minimizing dependencies. - Global Namespace Integration: Fully qualified `global::` namespaces for all system types and dependencies. - Disposal Management: Manage and clean up resources with built-in `Dispose` functionality. @@ -51,13 +51,13 @@ public class MyViewModel : ViewModelBase ``` Here, the `Set` method is used directly to assign the new value to the property without needing any additional configuration like `Changing` or `Changed`. -### Fluent `Command` Setup +### Fluent `FluentCommand` Setup Commands in MVVMFluent can be easily defined with `Do` methods, and you can add conditional execution using `If`. ```csharp public class MyViewModel : ViewModelBase { - public Command SaveCommand => Do(Save) + public FluentCommand SaveCommand => Do(Save) .If(CanSave); private void Save() @@ -69,13 +69,13 @@ public class MyViewModel : ViewModelBase } ``` -### Using `Command` for Generic Commands -In cases where you need commands that accept a parameter, you can use the generic `Command`. Both `Command` and `Command` implement the `ICommand` interface, making them compatible with WPF or any other MVVM framework that supports `ICommand`. +### Using `FluentCommand` for Generic Commands +In cases where you need commands that accept a parameter, you can use the generic `FluentCommand`. Both `FluentCommand` and `FluentCommand` implement the `ICommand` interface, making them compatible with WPF or any other MVVM framework that supports `ICommand`. ```csharp public class MyViewModel : ViewModelBase { - public Command SaveWithMessageCommand => Do(message => Save(message)) + public FluentCommand SaveWithMessageCommand => Do(message => Save(message)) .If(message => !string.IsNullOrEmpty(message)); private void Save(string message) @@ -85,7 +85,7 @@ public class MyViewModel : ViewModelBase } } ``` -This example demonstrates how `Command` can be used to handle parameterized commands with strongly-typed arguments. +This example demonstrates how `FluentCommand` can be used to handle parameterized commands with strongly-typed arguments. ### Using `Notify(nameof(...))` for Property Change Notifications You can also notify multiple properties when setting a value. This is useful when other properties are derived from or depend on the value being set. @@ -129,7 +129,7 @@ public class MyViewModel : ViewModelBase ``` In this example, if the `Counter` property hasn’t been set before, the Get(10) will return 10 as the default value. -### Asynchronous Command (`AsyncCommand`) +### Asynchronous FluentCommand (`AsyncCommand`) The AsyncCommand in the MVVMFluent library is designed to simplify asynchronous command execution with built-in support for cancellation, progress reporting, and exception handling. It allows you to execute long-running tasks without blocking the UI thread, while maintaining full control over the command's lifecycle. **Key Features:** @@ -168,14 +168,14 @@ public bool CanLoad { get => Get(true); set => Set(value); } In XAML: ```xml -