61 lines
1.3 KiB
C#
61 lines
1.3 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace TizenWatchfaceApp1
|
|
{
|
|
public class ClockViewModel : INotifyPropertyChanged
|
|
{
|
|
protected DateTime time = DateTime.MinValue;
|
|
protected int heartRate = 0;
|
|
protected int battery = 0;
|
|
|
|
public DateTime Time
|
|
{
|
|
get => time;
|
|
set
|
|
{
|
|
if (time == value) return;
|
|
|
|
time = value;
|
|
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public int HeartRate
|
|
{
|
|
get => heartRate;
|
|
set
|
|
{
|
|
if (heartRate == value) return;
|
|
|
|
heartRate = value;
|
|
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public int Battery
|
|
{
|
|
get => battery;
|
|
set
|
|
{
|
|
if (battery == value) return;
|
|
|
|
battery = value;
|
|
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
}
|
|
}
|