popups again

master
Anthony RICHARD 2 years ago
parent ba2bc4fa55
commit a01bf8e904

@ -5,7 +5,7 @@
x:Class="Stim.ConfirmationPopup"
CanBeDismissedByTappingOutsideOfPopup="False">
<Grid RowDefinitions="auto, *" ColumnDefinitions="*, *" Style="{StaticResource popupGrid}">
<Grid RowDefinitions="*, *" ColumnDefinitions="*, *" Style="{StaticResource popupGrid}">
<Label Grid.ColumnSpan="2" x:Name="placeholder" Style="{StaticResource popupLabel}"/>
<Button Grid.Row="2" Style="{StaticResource popupButton}" Text="Non" Clicked="No"/>
<Button Grid.Row="2" Grid.Column="2" Style="{StaticResource popupButton}" Text="Oui" Clicked="Yes"/>

@ -5,7 +5,7 @@
x:Class="Stim.MessagePopup"
CanBeDismissedByTappingOutsideOfPopup ="False">
<Grid RowDefinitions="auto, *" ColumnDefinitions="*" Style="{StaticResource popupGrid}">
<Grid RowDefinitions="*, *" ColumnDefinitions="*" Style="{StaticResource popupGrid}">
<Label x:Name="placeholder" Style="{StaticResource popupLabel}"/>
<Button Grid.Row="1" Text="Fermer" Style="{StaticResource popupButton}" Clicked="CloseButton"/>
</Grid>

@ -4,13 +4,14 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="Stim.ReviewPopUp"
CanBeDismissedByTappingOutsideOfPopup="False">
<Grid ColumnDefinitions="*" RowDefinitions="*, *, *, *, *">
<Label x:Name="placeholder" Style="{StaticResource popupLabel}"/>
<Entry Grid.Row="1" x:Name="Entrytxt" VerticalOptions="Center" HorizontalOptions="Center"/>
<Entry Grid.Row="2" x:Name="Val" VerticalOptions="Center" HorizontalOptions="Center"/>
<Button Grid.Row="3" Text="Valider" Style="{StaticResource popupButton}" Clicked="Valider"/>
<Button Grid.Row="4" Text="Annuler" Style="{StaticResource popupButton}" Clicked="CloseButton"/>
<HorizontalStackLayout x:Name="Error"/>
<Grid RowDefinitions="auto, auto, auto, auto, auto, auto, *" ColumnDefinitions="*, *" Style="{StaticResource popupGrid}">
<Label Grid.ColumnSpan="2" Text="Commentaire" Style="{StaticResource popupLabel}"/>
<Entry Grid.ColumnSpan="2" Grid.Row="2" x:Name="Entrytxt" Style="{StaticResource popupEntry}"/>
<Label Grid.ColumnSpan="2" Grid.Row="3" Text="Note sur 5" Style="{StaticResource popupLabel}"/>
<Entry Grid.ColumnSpan="2" Grid.Row="4" x:Name="Val" Style="{StaticResource popupEntry}" WidthRequest="25" HorizontalTextAlignment="Center"/>
<Button Grid.Row="5" Style="{StaticResource popupButton}" Text="Annuler" Clicked="CloseButton"/>
<Button Grid.Row="5" Grid.Column="2" Style="{StaticResource popupButton}" Text="Valider" Clicked="Valider"/>
<Label Grid.ColumnSpan="2" Grid.Row="6" x:Name="Error" Style="{StaticResource popupLabel}" TextColor="Red" Text=""/>
</Grid>
</toolkit:Popup>

@ -7,10 +7,11 @@ namespace Stim;
public partial class ReviewPopUp : Popup
{
private readonly bool editing = false;
private Review prevRev = null;
public ReviewPopUp(Review previousRev = null)
{
InitializeComponent();
private readonly Review prevRev = null;
public ReviewPopUp(Review previousRev = null)
{
InitializeComponent();
if (previousRev != null)
{
prevRev = previousRev;
@ -18,7 +19,7 @@ public partial class ReviewPopUp : Popup
Val.Text = previousRev.Rate.ToString();
editing = true;
}
}
}
public void CloseButton(object sender, EventArgs e)
{
@ -35,7 +36,6 @@ public partial class ReviewPopUp : Popup
bool isDouble = double.TryParse(Val.Text, NumberStyles.Float, CultureInfo.InvariantCulture, out double rate);
if (!string.IsNullOrWhiteSpace(Entrytxt.Text) && isDouble)
{
//Error.Text = "";
if (editing == true)
{
if (prevRev.Text != Entrytxt.Text) prevRev.EditReview(Entrytxt.Text);
@ -52,6 +52,6 @@ public partial class ReviewPopUp : Popup
((App)App.Current).Manager.SaveGames();
Close(res);
}
//else Error.Text = "Champ vide ou invalide";
else Error.Text = "Champ vide ou invalide";
}
}
}

@ -65,9 +65,6 @@
<Compile Update="DetailledPage - Copier.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
</Compile>
<Compile Update="ReviewPopUp.xaml.cs">
<DependentUpon>ReviewPopUp.xaml</DependentUpon>
</Compile>
<Compile Update="LoginPage.xaml.cs">
<DependentUpon>LoginPage.xaml</DependentUpon>
</Compile>
@ -92,9 +89,6 @@
<MauiXaml Update="DetailledPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ReviewPopUp.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="EntryPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
@ -107,6 +101,9 @@
<MauiXaml Update="MessagePopup.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ReviewPopUp.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="StarsContainer.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

Loading…
Cancel
Save