nouveaux styles popups + nouvelle popup confirmation oui non

Popup_qui_marche_pas
Anthony RICHARD 2 years ago
parent f26b307edb
commit b940af0596

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="Stim.ConfirmationPopup"
CanBeDismissedByTappingOutsideOfPopup="False">
<Grid RowDefinitions="*, *" ColumnDefinitions="*, *">
<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"/>
</Grid>
</toolkit:Popup>

@ -0,0 +1,17 @@
using CommunityToolkit.Maui.Views;
namespace Stim;
public partial class ConfirmationPopup : Popup
{
public ConfirmationPopup(string message)
{
InitializeComponent();
placeholder.Text = message;
}
public void Yes(object sender, EventArgs e)
=> Close(true);
public void No(object sender, EventArgs e)
=> Close(false);
}

@ -4,12 +4,11 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="Stim.EntryPopup"
CanBeDismissedByTappingOutsideOfPopup="False">
<VerticalStackLayout>
<Grid ColumnDefinitions="*" RowDefinitions="auto, auto, auto,auto">
<Label x:Name="LabelTxt"/>
<Entry Grid.Row="1" x:Name="Entrytxt"/>
<Grid ColumnDefinitions="*" RowDefinitions="*, *, *, *">
<Label x:Name="placeholder" Style="{StaticResource popupLabel}"/>
<Entry Grid.Row="1" x:Name="Entrytxt" VerticalOptions="Center" HorizontalOptions="Center"/>
<Button Grid.Row="2" Text="Valider" Style="{StaticResource popupButton}" Clicked="Valider"/>
<Button Grid.Row="3" Text="Annuler" Style="{StaticResource popupButton}" Clicked="CloseButton"/>
</Grid>
</VerticalStackLayout>
</toolkit:Popup>

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

@ -387,9 +387,30 @@
<!-- Styles ajoutés-->
<Style TargetType="Label" x:Key="popupLabel">
<Setter Property="Text" Value=""/>
<Setter Property="FontSize" Value="30"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="VerticalOptions" Value="Center"/>
</Style>
<Style TargetType="Button" x:Key="followButton">
<Setter Property="Text" Value="Suivre"/>
<Setter Property="Background" Value="{StaticResource Transparent}"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="BorderWidth" Value="3"/>
<Setter Property="BorderColor" Value="{StaticResource Secondary}"/>
<Setter Property="Margin" Value="10"/>
</Style>
<Style TargetType="Button" x:Key="popupButton">
<Setter Property="FontSize" Value="30"/>
<Setter Property="BorderColor" Value="{StaticResource Secondary}"/>
<Setter Property="BorderWidth" Value="2"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="VerticalOptions" Value="Center" />
<Setter Property="Background" Value="{StaticResource Transparent}"/>
</Style>
@ -403,8 +424,13 @@
<Setter Property="Margin" Value="0, 0, 10, 10"/>
</Style>
<Style TargetType="VerticalStackLayout" x:Key="pageBorder">
<Setter Property="Background" Value="{StaticResource Secondary}"/>
<Style TargetType="ImageButton" x:Key="removeButton">
<Setter Property="Source" Value="remove_red.png"/>
<Setter Property="Background" Value="{StaticResource Transparent}"/>
<Setter Property="WidthRequest" Value="50"/>
<Setter Property="HeightRequest" Value="50" />
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
</Style>
<Style TargetType="Image" x:Key="star">
@ -413,4 +439,10 @@
<Setter Property="WidthRequest" Value="30" />
</Style>
<Style TargetType="VerticalStackLayout" x:Key="pageBorder">
<Setter Property="Background" Value="{StaticResource Secondary}"/>
</Style>
</ResourceDictionary>

Loading…
Cancel
Save