Infört Observable Property överallt, där tillämpligt
This commit is contained in:
@ -2,54 +2,26 @@
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class PlayerColumn : ObservableObject
|
||||
public partial class PlayerColumn : ObservableObject
|
||||
{
|
||||
public PlayerColumn()
|
||||
{
|
||||
_playerName = string.Empty;
|
||||
_values = new List<string>();
|
||||
PlayerName = string.Empty;
|
||||
Values = new List<string>();
|
||||
}
|
||||
|
||||
|
||||
private int _playerId;
|
||||
private string _playerName;
|
||||
private List<string> _values;
|
||||
public string PlayerName
|
||||
{
|
||||
get { return _playerName; }
|
||||
set
|
||||
{
|
||||
_playerName = value;
|
||||
OnPropertyChanged(nameof(PlayerName));
|
||||
}
|
||||
}
|
||||
public List<string> Values
|
||||
{
|
||||
get { return _values; }
|
||||
set
|
||||
{
|
||||
_values = value;
|
||||
OnPropertyChanged(nameof(Values));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
private int playerId;
|
||||
|
||||
public int PlayerId
|
||||
{
|
||||
get { return _playerId; }
|
||||
set
|
||||
{
|
||||
_playerId = value;
|
||||
OnPropertyChanged(nameof(PlayerId));
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string playerName;
|
||||
|
||||
private int _playerPoints;
|
||||
[ObservableProperty]
|
||||
private List<string> values;
|
||||
|
||||
public int PlayerPoints
|
||||
{
|
||||
get { return _playerPoints; }
|
||||
set { _playerPoints = value; }
|
||||
}
|
||||
[ObservableProperty]
|
||||
private int playerPoints;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,52 +6,21 @@ public partial class RoundBuilderGroup : ObservableObject
|
||||
{
|
||||
public RoundBuilderGroup()
|
||||
{
|
||||
_gameRoundId = 0;
|
||||
_gameRoundStartDate = DateTime.MinValue;
|
||||
_status = GamePointStatus.New;
|
||||
GameRoundId = 0;
|
||||
GameRoundStartDate = DateTime.MinValue;
|
||||
Status = GamePointStatus.New;
|
||||
Elements = new List<RoundBuilderElement>();
|
||||
}
|
||||
private int _gameRoundId;
|
||||
private DateTime _gameRoundStartDate;
|
||||
|
||||
[ObservableProperty]
|
||||
private int gameRoundId;
|
||||
|
||||
[ObservableProperty]
|
||||
private DateTime gameRoundStartDate;
|
||||
|
||||
[ObservableProperty]
|
||||
private GamePointStatus _status;
|
||||
|
||||
[ObservableProperty]
|
||||
private List<RoundBuilderElement> elements;
|
||||
public int GameRoundId
|
||||
{
|
||||
get { return _gameRoundId; }
|
||||
set
|
||||
{
|
||||
_gameRoundId = value;
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
public DateTime GameRoundStartDate
|
||||
{
|
||||
get { return _gameRoundStartDate; }
|
||||
set
|
||||
{
|
||||
_gameRoundStartDate = value;
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
public GamePointStatus Status
|
||||
{
|
||||
get { return _status; }
|
||||
set
|
||||
{
|
||||
_status = value;
|
||||
// No need to raise property changed for this example
|
||||
}
|
||||
}
|
||||
|
||||
//public List<RoundBuilderElement> Elements
|
||||
//{
|
||||
// get { return _elements; }
|
||||
// set
|
||||
// {
|
||||
// _elements = value;
|
||||
// OnPropertyChanged(nameof(Elements));
|
||||
// // No need to raise property changed for this example
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user