diff --git a/src/CSharp/EasyMicroservices.UI.Core.Mvvm/BaseViewModel.cs b/src/CSharp/EasyMicroservices.UI.Core.Mvvm/BaseViewModel.cs index 3334ef3..395dc0f 100644 --- a/src/CSharp/EasyMicroservices.UI.Core.Mvvm/BaseViewModel.cs +++ b/src/CSharp/EasyMicroservices.UI.Core.Mvvm/BaseViewModel.cs @@ -14,7 +14,7 @@ public abstract class BaseViewModel : INotifyPropertyChanged /// /// /// - public bool IsBusy + public virtual bool IsBusy { get => _IsBusy; set @@ -41,7 +41,7 @@ public virtual void OnPropertyChanged(string propertyName) /// /// /// - public void Busy() + public virtual void Busy() { IsBusy = true; } @@ -49,7 +49,7 @@ public void Busy() /// /// /// - public void UnBusy() + public virtual void UnBusy() { IsBusy = false; } @@ -62,7 +62,7 @@ public void UnBusy() /// /// /// - public async virtual Task FetchData(Func> getServerResult, Func onSuccess, Func onError = default) + public async virtual Task ExecuteApi(Func> getServerResult, Func onSuccess, Func onError = default) { try { @@ -95,9 +95,9 @@ public async virtual Task FetchData(Func> getServerResult /// /// /// - public Task FetchData(Func> getServerResult, Func onSuccess, Func onError = default) + public virtual Task ExecuteApi(Func> getServerResult, Func onSuccess, Func onError = default) { - return FetchData(getServerResult, async (x) => + return ExecuteApi(getServerResult, async (x) => { await onSuccess(); }, onError); diff --git a/src/CSharp/EasyMicroservices.UI.Core.Mvvm/Commands/RelayCommand.cs b/src/CSharp/EasyMicroservices.UI.Core.Mvvm/Commands/RelayCommand.cs index 4aa7b98..0ed1566 100644 --- a/src/CSharp/EasyMicroservices.UI.Core.Mvvm/Commands/RelayCommand.cs +++ b/src/CSharp/EasyMicroservices.UI.Core.Mvvm/Commands/RelayCommand.cs @@ -17,6 +17,16 @@ public RelayCommand(Action execute, Func canExecute) { } + + /// + /// + /// + /// + public RelayCommand(Action execute) + : this(execute, () => true) + { + + } } /// @@ -35,4 +45,14 @@ public RelayCommand(Action execute, Func canExecute) { } + + /// + /// + /// + /// + public RelayCommand(Action execute) + : this((x) => execute((T)x), (x) => true) + { + + } } \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.UI.Core.Mvvm/EasyMicroservices.UI.Core.Mvvm.csproj b/src/CSharp/EasyMicroservices.UI.Core.Mvvm/EasyMicroservices.UI.Core.Mvvm.csproj index d0bc3fd..40b5ade 100644 --- a/src/CSharp/EasyMicroservices.UI.Core.Mvvm/EasyMicroservices.UI.Core.Mvvm.csproj +++ b/src/CSharp/EasyMicroservices.UI.Core.Mvvm/EasyMicroservices.UI.Core.Mvvm.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.1 + 0.0.0.2 Model View View Model EasyMicroservices@gmail.com mvvm,mvpvm,modelview,modelviewviewmodel