🚧 databinding selection map
continuous-integration/drone/push Build is passing Details

pull/95/head
Lucas DUFLOT 11 months ago
parent 9fae1d2702
commit de321a0726

@ -0,0 +1,26 @@
using System.Collections.ObjectModel;
using System.Data;
using Models.Game;
namespace Stub
{
public class Stub
{
public ReadOnlyObservableCollection<Map> ListMap { get; private set; }
private readonly ObservableCollection<Map> listmap = new ObservableCollection<Map>();
public Stub()
{
ListMap = new ReadOnlyObservableCollection<Map>(listmap);
LoadMap();
}
public void LoadMap() {
listmap.Add(new Map("profile.jpg"));
listmap.Add(new Map("montagne1.png"));
listmap.Add(new Map("tmp1.jpeg"));
}
}
}

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup>
</Project>

@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp", "ConsoleApp\Co
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{383C4215-C680-4C2E-BC7E-B62F0B164370}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{383C4215-C680-4C2E-BC7E-B62F0B164370}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stub", "Stub\Stub.csproj", "{2C01B1A9-302F-4DDF-A2BA-84173ABA1008}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -35,6 +37,10 @@ Global
{383C4215-C680-4C2E-BC7E-B62F0B164370}.Debug|Any CPU.Build.0 = Debug|Any CPU {383C4215-C680-4C2E-BC7E-B62F0B164370}.Debug|Any CPU.Build.0 = Debug|Any CPU
{383C4215-C680-4C2E-BC7E-B62F0B164370}.Release|Any CPU.ActiveCfg = Release|Any CPU {383C4215-C680-4C2E-BC7E-B62F0B164370}.Release|Any CPU.ActiveCfg = Release|Any CPU
{383C4215-C680-4C2E-BC7E-B62F0B164370}.Release|Any CPU.Build.0 = Release|Any CPU {383C4215-C680-4C2E-BC7E-B62F0B164370}.Release|Any CPU.Build.0 = Release|Any CPU
{2C01B1A9-302F-4DDF-A2BA-84173ABA1008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C01B1A9-302F-4DDF-A2BA-84173ABA1008}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C01B1A9-302F-4DDF-A2BA-84173ABA1008}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C01B1A9-302F-4DDF-A2BA-84173ABA1008}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

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

@ -63,6 +63,11 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Models\Models.csproj" />
<ProjectReference Include="..\Stub\Stub.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Views\PageLeaderBoard.xaml.cs"> <Compile Update="Views\PageLeaderBoard.xaml.cs">
<DependentUpon>PageLeaderBoard.xaml</DependentUpon> <DependentUpon>PageLeaderBoard.xaml</DependentUpon>

@ -0,0 +1,37 @@
<?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">
<CarouselView ItemsSource="{Binding ListMap}"
PeekAreaInsets="800">
<CarouselView.ItemTemplate>
<DataTemplate>
<Frame HasShadow="True"
BorderColor="DarkGray"
CornerRadius="5"
Margin="20"
HeightRequest="300"
WidthRequest="200"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand">
<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>
</CarouselView.ItemTemplate>
</CarouselView>
</Grid>
</ContentPage>

@ -0,0 +1,14 @@
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