Correction bug SmashGG Id / Changement Fenetre

This commit is contained in:
2022-07-30 14:41:57 +02:00
parent 688bb257a5
commit d4ff238494
4 changed files with 20 additions and 5 deletions

View File

@@ -9,5 +9,6 @@
public string ImgUrl { get; set; }
public string WordPressTag { get; set; }
public string WordPressTagOs { get; set; }
public int? SmashId { get; set; }
}
}

View File

@@ -10,7 +10,7 @@ using LaDOSE.REST.Event;
namespace LaDOSE.DesktopApp.ViewModels
{
public class ShellViewModel : Conductor<IScreen>.Collection.AllActive
public class ShellViewModel : Conductor<IScreen>.Collection.OneActive
{
private string _user;
@@ -62,6 +62,7 @@ namespace LaDOSE.DesktopApp.ViewModels
public void LoadGames()
{
ActivateItem(new GameViewModel(IoC.Get<RestService>()));
}
public void TournamentResult()

View File

@@ -168,9 +168,13 @@ namespace LaDOSE.DesktopApp.ViewModels
{
_selectedGame = value;
//TODO: QUICK AND DIRTY
List<ResultDTO> resultForGame = this.Results.Results.Where(e => e.GameId == SelectedGame.Id).ToList();
List<ResultDTO> resultForGame = this.Results.Results.Where(e => e.GameId == SelectedGame?.Id).ToList();
if (resultForGame.Any())
{
First = resultForGame.OrderByDescending(e => e.Point).First().Player;
SelectedGameResult = new ObservableCollection<ResultDTO>(resultForGame);
}
NotifyOfPropertyChange(() => SelectedGame);
}
}

View File

@@ -42,10 +42,10 @@
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Row="0" Grid.Column="0" x:Name="AddGame">Add Game</Button>
@@ -71,6 +71,15 @@
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding Path=CurrentGame.WordPressTag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></TextBox>
<Label Grid.Row="6" Grid.Column="0">WpTagOs</Label>
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding Path=CurrentGame.WordPressTagOs,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></TextBox>
<Label Grid.Row="7" Grid.Column="0">SmashId</Label>
<TextBox Grid.Row="7" Grid.Column="1" Text="{Binding Path=CurrentGame.SmashId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<i:Interaction.Behaviors>
<behaviors:TextBoxInputRegExBehaviour RegularExpression="^\d+$" MaxLength="9" EmptyValue="">
</behaviors:TextBoxInputRegExBehaviour>
</i:Interaction.Behaviors>
</TextBox>
<Button Grid.Row="9" Grid.ColumnSpan="2" x:Name="Update">Update</Button>
</Grid>