Infört Observable Property överallt, där tillämpligt
This commit is contained in:
@ -2,127 +2,55 @@
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class RoundBuilderElement : ObservableObject
|
||||
public partial class RoundBuilderElement : ObservableObject
|
||||
{
|
||||
public RoundBuilderElement()
|
||||
{
|
||||
_participantId = 0;
|
||||
_participantName = string.Empty;
|
||||
_gameRoundRegNr = 0;
|
||||
_gameRegPoints = 0;
|
||||
_status = GamePointStatus.New;
|
||||
_gameRoundStartDate = DateTime.MinValue;
|
||||
_gameRoundId = 0;
|
||||
_gamePointId = 0;
|
||||
ParticipantId = 0;
|
||||
ParticipantName = string.Empty;
|
||||
GameRoundRegNr = 0;
|
||||
GameRegPoints = 0;
|
||||
Status = GamePointStatus.New;
|
||||
GameRoundStartDate = DateTime.MinValue;
|
||||
GameRoundId = 0;
|
||||
GamePointId = 0;
|
||||
}
|
||||
|
||||
private int _participantId;
|
||||
private string _participantName;
|
||||
private int _gameRoundRegNr;
|
||||
private int _gameRegPoints;
|
||||
private GamePointStatus _status;
|
||||
private DateTime _gameRoundStartDate;
|
||||
private int _gameRoundId;
|
||||
private int _gamePointId;
|
||||
[ObservableProperty]
|
||||
private int participantId;
|
||||
|
||||
public int ParticipantId
|
||||
{
|
||||
get { return _participantId; }
|
||||
set
|
||||
{
|
||||
_participantId = value;
|
||||
OnPropertyChanged(nameof(ParticipantId));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string participantName;
|
||||
|
||||
[ObservableProperty]
|
||||
private int gameRoundRegNr;
|
||||
|
||||
public string ParticipantName
|
||||
{
|
||||
get { return _participantName; }
|
||||
set
|
||||
{
|
||||
_participantName = value;
|
||||
OnPropertyChanged(nameof(ParticipantName));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
private int gameRegPoints;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(StatusString))]
|
||||
private GamePointStatus status;
|
||||
|
||||
public int GameRoundRegNr
|
||||
{
|
||||
get { return _gameRoundRegNr; }
|
||||
set
|
||||
{
|
||||
_gameRoundRegNr = value;
|
||||
OnPropertyChanged(nameof(GameRoundRegNr));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(GameRoundStartDateString))]
|
||||
private DateTime gameRoundStartDate;
|
||||
|
||||
[ObservableProperty]
|
||||
private int gameRoundId;
|
||||
|
||||
public int GameRegPoints
|
||||
{
|
||||
get { return _gameRegPoints; }
|
||||
set
|
||||
{
|
||||
_gameRegPoints = value;
|
||||
OnPropertyChanged(nameof(GameRegPoints));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public GamePointStatus Status
|
||||
{
|
||||
get { return _status; }
|
||||
set
|
||||
{
|
||||
_status = value;
|
||||
OnPropertyChanged(nameof(Status));
|
||||
OnPropertyChanged(nameof(StatusString));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
private int gamePointId;
|
||||
|
||||
public string StatusString
|
||||
{
|
||||
get { return _status.ToString(); }
|
||||
}
|
||||
|
||||
public DateTime GameRoundStartDate
|
||||
{
|
||||
get { return _gameRoundStartDate; }
|
||||
set
|
||||
{
|
||||
_gameRoundStartDate = value;
|
||||
OnPropertyChanged(nameof(GameRoundStartDate));
|
||||
OnPropertyChanged(nameof(GameRoundStartDateString));
|
||||
}
|
||||
get { return status.ToString(); }
|
||||
}
|
||||
|
||||
public string GameRoundStartDateString
|
||||
{
|
||||
get { return _gameRoundStartDate.ToString("yyyy-MM-dd"); }
|
||||
get { return gameRoundStartDate.ToString("yyyy-MM-dd"); }
|
||||
}
|
||||
|
||||
public int GameRoundId
|
||||
{
|
||||
get { return _gameRoundId; }
|
||||
set
|
||||
{
|
||||
_gameRoundId = value;
|
||||
OnPropertyChanged(nameof(GameRoundId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int GamePointId
|
||||
{
|
||||
get { return _gamePointId; }
|
||||
set
|
||||
{
|
||||
_gamePointId = value;
|
||||
OnPropertyChanged(nameof(GamePointId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user