SHARE
TWEET

Untitled

a guest Dec 16th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.ComponentModel;
  2. using System.Runtime.CompilerServices;
  3.  
  4. namespace VideoGameMusicApp.ViewModels
  5. {
  6.     public class BaseViewModel : INotifyPropertyChanged
  7.     {
  8.         public event PropertyChangedEventHandler PropertyChanged;
  9.  
  10.         protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
  11.         {
  12.             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  13.         }
  14.  
  15.         protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = null)
  16.         {
  17.             if (object.Equals(storage, value)) return false;
  18.             storage = value;
  19.             OnPropertyChanged(propertyName);
  20.             return true;
  21.         }
  22.  
  23.         private bool _isLoading = false;
  24.  
  25.         public bool IsLoading
  26.         {
  27.             get => _isLoading;
  28.             set => SetProperty(ref _isLoading, value);
  29.         }
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top