-
-
Save devjaime/bd5aac6def0a647dada45cd9926cbe4e to your computer and use it in GitHub Desktop.
BaseViewModel.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading.Tasks; | |
| namespace Acelerometro.ViewModel | |
| { | |
| public class BaseViewModel : ObservableObject | |
| { | |
| bool isBusy; | |
| public bool IsBusy | |
| { | |
| get => isBusy; | |
| set => SetProperty(ref isBusy, value, onChanged: () => OnPropertyChanged(nameof(IsNotBusy))); | |
| } | |
| public bool IsNotBusy => !IsBusy; | |
| public virtual void OnAppearing() | |
| { | |
| } | |
| public virtual void OnDisappearing() | |
| { | |
| } | |
| internal event Func<string, Task> DoDisplayAlert; | |
| public Task DisplayAlertAsync(string message) | |
| { | |
| return DoDisplayAlert?.Invoke(message) ?? Task.CompletedTask; | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment