Correction du bug avec InitializeComponent + début manager

devGuillaume
Yoan BRUGIÈRE 2 years ago
parent 3a957d346b
commit 201c874875

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public interface IDataManager
{
IEnumerable<Bateau> RecupererBateau();
IEnumerable<Bestiaire> RecupererBestiaire();
IEnumerable<Equipage> RecupererEquipage();
IEnumerable<FruitDuDemon> RecupererFruit();
IEnumerable<Ile> RecupererIle();
IEnumerable<Personnage> RecupererPersonnage();
}
}

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
internal class Manager
{
}
}

@ -48,16 +48,6 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<MauiXaml Remove="PageIle.xaml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PageIle.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup> </ItemGroup>
@ -91,6 +81,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="PageIle.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageCarte.xaml"> <MauiXaml Update="PageCarte.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
@ -115,6 +108,9 @@
<MauiXaml Update="PageBateau.xaml"> <MauiXaml Update="PageBateau.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="PageIle.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -55,14 +55,16 @@
</Frame> </Frame>
</Grid> </Grid>
<CollectionView x:Name="listeFDD" Style="{StaticResource RespCollection}"> <CollectionView x:Name="listeFDD" ItemsLayout="VerticalGrid, 4">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20" > <Grid Padding="20" ColumnSpacing="20" RowSpacing="20" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/> <ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Frame CornerRadius="25" <Frame CornerRadius="25"
BackgroundColor="#e2edf1" BackgroundColor="#e2edf1"
BorderColor="#72a3b3" BorderColor="#72a3b3"

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageIle" x:Class="Ohara.PageIle"
@ -125,18 +125,6 @@
</CollectionView> </CollectionView>
</ScrollView> </ScrollView>
</VerticalStackLayout> </VerticalStackLayout>
<!--<Rectangle WidthRequest="200" HeightRequest="300" HorizontalOptions="Start" BackgroundColor="#72a3b3">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="#cdffd8" Offset="0.0" />-->
<!--<GradientStop Color="#94b9ff" Offset="1.0" /></LinearGradientBrush></Rectangle.Fill></Rectangle>-->
</Grid> </Grid>

@ -1,4 +1,4 @@
using Model.Stub; using Model.Stub;
using Model; using Model;
namespace Ohara; namespace Ohara;
@ -7,22 +7,31 @@ public partial class PageIle : ContentPage
{ {
public PageIle() public PageIle()
{ {
InitializeComponent(); InitializeComponent();
List<Ile> ile = StubIle.RecupererIle().ToList(); List<Ile> ile = StubIle.RecupererIle().ToList();
listeIle.ItemsSource = ile; listeIle.ItemsSource = ile;
} }
private async void Hyperlink_FDD(object sender, EventArgs e) private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
{ {
await Navigation.PushAsync(new PageFDD());
}
private async void Hyperlink_Accueil(object sender, EventArgs e)
{
await Navigation.PushAsync(new MainPage());
} }
private async void Hyperlink_Equip(object sender, EventArgs e) private async void Hyperlink_Equip(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageEquipage()); await Navigation.PushAsync(new PageEquipage());
} }
private async void Hyperlink_FDD(object sender, EventArgs e)
{
await Navigation.PushAsync(new PageFDD());
}
private async void Hyperlink_Perso(object sender, EventArgs e) private async void Hyperlink_Perso(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PagePersonnage()); await Navigation.PushAsync(new PagePersonnage());
@ -31,16 +40,13 @@ public partial class PageIle : ContentPage
{ {
await Navigation.PushAsync(new PageCarte()); await Navigation.PushAsync(new PageCarte());
} }
private async void Hyperlink_Accueil(object sender, EventArgs e) private async void Hyperlink_Bateau(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new MainPage()); await Navigation.PushAsync(new PageBateau());
} }
private async void Hyperlink_Bestiaire(object sender, EventArgs e) private async void Hyperlink_Bestiaire(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageBestiaire()); await Navigation.PushAsync(new PageBestiaire());
} }
private async void Hyperlink_Bateau(object sender, EventArgs e)
{
await Navigation.PushAsync(new PageBateau());
}
} }

@ -480,6 +480,8 @@
<VisualState.Setters> <VisualState.Setters>
<Setter Property="ItemsLayout" <Setter Property="ItemsLayout"
Value="VerticalGrid, 1" /> Value="VerticalGrid, 1" />
<Setter Property="BackgroundColor"
Value="Green"/>
</VisualState.Setters> </VisualState.Setters>
</VisualState> </VisualState>
<VisualState x:Name="Moyen"> <VisualState x:Name="Moyen">
@ -489,15 +491,20 @@
<VisualState.Setters> <VisualState.Setters>
<Setter Property="ItemsLayout" <Setter Property="ItemsLayout"
Value="VerticalGrid, 2" /> Value="VerticalGrid, 2" />
<Setter Property="BackgroundColor"
Value="Blue"/>
</VisualState.Setters> </VisualState.Setters>
</VisualState> </VisualState>
<VisualState x:Name="Grand"> <VisualState x:Name="Grand">
<VisualState.StateTriggers> <VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="960" /> <AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers> </VisualState.StateTriggers>
<VisualState.Setters> <VisualState.Setters>
<Setter Property="ItemsLayout" <Setter Property="ItemsLayout"
Value="VerticalGrid, 4" /> Value="HorizontalList" />
<Setter Property="BackgroundColor"
Value="Red"/>
</VisualState.Setters> </VisualState.Setters>
</VisualState> </VisualState>
</VisualStateGroup> </VisualStateGroup>

Loading…
Cancel
Save