Infört Observable Property och observable object från Community Toolkit
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
using Common.Library;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class PlayerColumn : EntityBase
|
||||
public class PlayerColumn : ObservableObject
|
||||
{
|
||||
public PlayerColumn()
|
||||
{
|
||||
@ -20,7 +20,7 @@ public class PlayerColumn : EntityBase
|
||||
set
|
||||
{
|
||||
_playerName = value;
|
||||
RaisePropertyChanged(nameof(PlayerName));
|
||||
OnPropertyChanged(nameof(PlayerName));
|
||||
}
|
||||
}
|
||||
public List<string> Values
|
||||
@ -29,7 +29,7 @@ public class PlayerColumn : EntityBase
|
||||
set
|
||||
{
|
||||
_values = value;
|
||||
RaisePropertyChanged(nameof(Values));
|
||||
OnPropertyChanged(nameof(Values));
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class PlayerColumn : EntityBase
|
||||
set
|
||||
{
|
||||
_playerId = value;
|
||||
RaisePropertyChanged(nameof(PlayerId));
|
||||
OnPropertyChanged(nameof(PlayerId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using Common.Library;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class RoundBuilderElement : EntityBase
|
||||
public class RoundBuilderElement : ObservableObject
|
||||
{
|
||||
public RoundBuilderElement()
|
||||
{
|
||||
@ -31,7 +31,7 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_participantId = value;
|
||||
RaisePropertyChanged(nameof(ParticipantId));
|
||||
OnPropertyChanged(nameof(ParticipantId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_participantName = value;
|
||||
RaisePropertyChanged(nameof(ParticipantName));
|
||||
OnPropertyChanged(nameof(ParticipantName));
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_gameRoundRegNr = value;
|
||||
RaisePropertyChanged(nameof(GameRoundRegNr));
|
||||
OnPropertyChanged(nameof(GameRoundRegNr));
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_gameRegPoints = value;
|
||||
RaisePropertyChanged(nameof(GameRegPoints));
|
||||
OnPropertyChanged(nameof(GameRegPoints));
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,8 +75,8 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_status = value;
|
||||
RaisePropertyChanged(nameof(Status));
|
||||
RaisePropertyChanged(nameof(StatusString));
|
||||
OnPropertyChanged(nameof(Status));
|
||||
OnPropertyChanged(nameof(StatusString));
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,8 +91,8 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_gameRoundStartDate = value;
|
||||
RaisePropertyChanged(nameof(GameRoundStartDate));
|
||||
RaisePropertyChanged(nameof(GameRoundStartDateString));
|
||||
OnPropertyChanged(nameof(GameRoundStartDate));
|
||||
OnPropertyChanged(nameof(GameRoundStartDateString));
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_gameRoundId = value;
|
||||
RaisePropertyChanged(nameof(GameRoundId));
|
||||
OnPropertyChanged(nameof(GameRoundId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public class RoundBuilderElement : EntityBase
|
||||
set
|
||||
{
|
||||
_gamePointId = value;
|
||||
RaisePropertyChanged(nameof(GamePointId));
|
||||
OnPropertyChanged(nameof(GamePointId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,21 @@
|
||||
using Common.Library;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace GreadyPoang.EntityLayer;
|
||||
|
||||
public class RoundBuilderGroup : EntityBase
|
||||
public partial class RoundBuilderGroup : ObservableObject
|
||||
{
|
||||
public RoundBuilderGroup()
|
||||
{
|
||||
_gameRoundId = 0;
|
||||
_gameRoundStartDate = DateTime.MinValue;
|
||||
_status = GamePointStatus.New;
|
||||
_elements = new List<RoundBuilderElement>();
|
||||
Elements = new List<RoundBuilderElement>();
|
||||
}
|
||||
private int _gameRoundId;
|
||||
private DateTime _gameRoundStartDate;
|
||||
private GamePointStatus _status;
|
||||
private List<RoundBuilderElement> _elements;
|
||||
[ObservableProperty]
|
||||
private List<RoundBuilderElement> elements;
|
||||
public int GameRoundId
|
||||
{
|
||||
get { return _gameRoundId; }
|
||||
@ -43,14 +44,14 @@ public class RoundBuilderGroup : EntityBase
|
||||
}
|
||||
}
|
||||
|
||||
public List<RoundBuilderElement> Elements
|
||||
{
|
||||
get { return _elements; }
|
||||
set
|
||||
{
|
||||
_elements = value;
|
||||
RaisePropertyChanged(nameof(Elements));
|
||||
// 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