diff --git a/src/Vetuviem.Core/CommandBinding.cs b/src/Vetuviem.Core/CommandBinding.cs index 5b30a0e..e3c2d9d 100644 --- a/src/Vetuviem.Core/CommandBinding.cs +++ b/src/Vetuviem.Core/CommandBinding.cs @@ -15,12 +15,9 @@ namespace Vetuviem.Core /// Represents a command binding between a control and a viewmodel. /// /// The type for the viewmodel. - public sealed class CommandBinding : ICommandBinding + public class CommandBinding : CommandBinding where TViewModel : class { - private readonly Expression?>> _viewModelBinding; - private readonly string? _toEvent; - /// /// Initializes a new instance of the class. /// @@ -29,6 +26,62 @@ public sealed class CommandBinding : ICommandBinding?>> viewModelBinding, string? toEvent = null) + : base( + viewModelBinding, + toEvent) + { + } + } + + /// + /// Represents a command binding between a control and a viewmodel. + /// + /// The type for the viewmodel. + /// + /// The type of the values that are the result of command execution. + /// + public class CommandBinding : CommandBinding + where TViewModel : class + { + /// + /// Initializes a new instance of the class. + /// + /// Expression for the View Model binding. + /// If specified, bind to the specific event instead of the default. + public CommandBinding( + Expression?>> viewModelBinding, + string? toEvent = null) + : base( + viewModelBinding, + toEvent) + { + } + } + + /// + /// Represents a command binding between a control and a viewmodel. + /// + /// The type for the viewmodel. + /// + /// The type of parameter values passed in during command execution. + /// + /// + /// The type of the values that are the result of command execution. + /// + public class CommandBinding : ICommandBinding + where TViewModel : class + { + private readonly Expression?>> _viewModelBinding; + private readonly string? _toEvent; + + /// + /// Initializes a new instance of the class. + /// + /// Expression for the View Model binding. + /// If specified, bind to the specific event instead of the default. + public CommandBinding( + Expression?>> viewModelBinding, + string? toEvent = null) { _viewModelBinding = viewModelBinding; _toEvent = toEvent;