Merge PageSelectMap into dev
continuous-integration/drone/push Build is passing Details

pull/99/head
Rémi LAVERGNE 11 months ago
commit a21dd9c018

@ -9,11 +9,15 @@ namespace Stub
{
public ReadOnlyObservableCollection<Player> ListPlayer { get; private set; }
private readonly ObservableCollection<Player> listplayer = new ObservableCollection<Player>();
public ReadOnlyObservableCollection<Map> ListMap { get; private set; }
private readonly ObservableCollection<Map> listmap = new ObservableCollection<Map>();
public Stub()
{
LoadPlayer();
ListPlayer = new ReadOnlyObservableCollection<Player>(listplayer);
ListMap = new ReadOnlyObservableCollection<Map>(listmap);
LoadMap();
}
public void LoadPlayer()
@ -31,10 +35,19 @@ namespace Stub
listplayer.Add(new Player(pseudo, profilePicture));
}
public void LoadMap()
{
listmap.Add(new Map("profile.jpg"));
listmap.Add(new Map("montagne1.png"));
listmap.Add(new Map("tmp1.jpeg"));
}
public void Pop(string pseudo, string profilePicture)
{
listplayer.Remove(new Player(pseudo, profilePicture));
}
public bool Modify(string pseudo, string newpseudo)
{
foreach(var index in listplayer)

@ -29,10 +29,10 @@
ContentTemplate="{DataTemplate views:PageRegles}"
Route="Regles"/>
<!--<ShellContent
<ShellContent
Title="Map Select"
ContentTemplate="{DataTemplate views:PageMapSelect}"
Route="MapSelect"/>-->
ContentTemplate="{DataTemplate views:PageSelectMap}"
Route="PageSelectMap"/>
<!--<ShellContent
Title="Plateau"

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Trek_12.Views.PageSelectMap"
Title="PageSelectMap">
<Grid RowDefinitions="auto,auto,auto">
<Label Grid.Row="0" Text="Sélection de la Carte" HorizontalOptions="Center" FontSize="Header"/>
<CollectionView Grid.Row="1"
ItemsSource="{Binding ListMap}"
ItemsLayout="HorizontalList"
HorizontalOptions="Center"
SelectionMode="Single">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame HasShadow="True"
BorderColor="DarkGray"
CornerRadius="5"
Margin="20"
HeightRequest="300"
WidthRequest="200"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"
x:Name="Frame">
<Grid RowDefinitions="auto,*">
<Label Text="{Binding Background}"
FontAttributes="Bold"
FontSize="18"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Image Source="{Binding Background}"
Aspect="AspectFill"
HeightRequest="150"
WidthRequest="150"
HorizontalOptions="Center"
Grid.Row="1"/>
</Grid>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Button Text="Retour"
FontAttributes="Bold"
FontSize="Large"
Grid.Row="2"
HorizontalOptions="Start"
Margin="100"/>
<Button Text="Jouer"
FontAttributes="Bold"
FontSize="Large"
Grid.Row="2"
HorizontalOptions="End"
Margin="100"/>
</Grid>
</ContentPage>

@ -0,0 +1,16 @@
namespace Trek_12.Views;
using Stub;
public partial class PageSelectMap : ContentPage
{
public Stub MyStub { get; set; } = new Stub();
public PageSelectMap()
{
InitializeComponent();
BindingContext = MyStub;
}
}
Loading…
Cancel
Save