Guest User

Untitled

a guest
May 16th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 KB | None | 0 0
  1. public partial class MainPage : PhoneApplicationPage
  2.     {
  3.         // Constructor
  4.         public MainPage()
  5.         {
  6.             InitializeComponent();
  7.  
  8.             DataContext = this;
  9.  
  10.             WorkoutStatus = "Idle";
  11.             RepsRemaining = 0;
  12.             TimeRemaining = 0.00;
  13.         }
  14.  
  15.         private string workoutStatus { get; set; }
  16.         public string WorkoutStatus
  17.         {
  18.             get { return WorkoutStatus; }
  19.  
  20.             set
  21.             {
  22.                 if (WorkoutStatus == value) return;
  23.                 workoutStatus = value;
  24.                 NotifyPropertyChanged("WorkoutStatus");
  25.             }
  26.         }
  27.  
  28.         private int repsRemaining;
  29.         public int RepsRemaining
  30.         {
  31.             get { return repsRemaining; }
  32.  
  33.             set
  34.             {
  35.                 if (repsRemaining == value) return;
  36.                 repsRemaining = value;
  37.                 NotifyPropertyChanged("RepsRemaining");
  38.             }
  39.         }
  40.  
  41.         private double timeRemaining;
  42.         public double TimeRemaining
  43.         {
  44.             get { return timeRemaining; }
  45.  
  46.             set
  47.             {
  48.                 if (timeRemaining == value) return;
  49.                 timeRemaining = value;
  50.                 NotifyPropertyChanged("TimeRemaining");
  51.             }
  52.         }
  53.  
  54.         public event PropertyChangedEventHandler PropertyChanged;
  55.         public void NotifyPropertyChanged(string propertyName)
  56.         {
  57.             if (PropertyChanged != null)
  58.             {
  59.                 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  60.             }
  61.         }
Add Comment
Please, Sign In to add comment