Added better navigation and modification in AppShell.xaml

dictionnaire
Matheo HERSAN 2 years ago
parent a68277586f
commit 8b12a07fb8

@ -5,32 +5,39 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MangaMap"
xmlns:Views="clr-namespace:MangaMap.Views"
Shell.FlyoutBehavior="Flyout"
Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="False">
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate Views:homePage}"
<TabBar>
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate Views:homePage}"
Route="MainPage" />
<ShellContent
Title="Inscription"
ContentTemplate="{DataTemplate Views:signUpPage}" />
<ShellContent
Title="Inscription"
ContentTemplate="{DataTemplate Views:signUpPage}" />
<ShellContent
Title="Connection"
ContentTemplate="{DataTemplate Views:loginPage}" />
<ShellContent
Title="Connection"
ContentTemplate="{DataTemplate Views:loginPage}" />
<ShellContent
Title="Paramètres"
ContentTemplate="{DataTemplate Views:settingsPage}" />
<ShellContent
Title="Paramètres"
ContentTemplate="{DataTemplate Views:settingsPage}" />
<ShellContent
Title="Liste"
ContentTemplate="{DataTemplate Views:listPage}" />
<ShellContent
Title="Liste"
ContentTemplate="{DataTemplate Views:listPage}" />
<ShellContent
Title="Fiche Exemple"
ContentTemplate="{DataTemplate Views:ficheAnime}" />
</TabBar>
<FlyoutItem>
<ShellContent
Title="Fiche Exemple"
ContentTemplate="{DataTemplate Views:ficheAnime}" />
</FlyoutItem>
</Shell>

@ -73,6 +73,9 @@
<MauiXaml Update="Resources\Theme\DarkTheme.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Composants\StyleBouton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\homePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MangaMap.Views.Composants.StyleBouton">
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Red"
Source="test2.png"
Clicked="ButtonIsPressed"/>
</ContentView>

@ -0,0 +1,14 @@
namespace MangaMap.Views.Composants;
public partial class StyleBouton : ContentView
{
public StyleBouton()
{
InitializeComponent();
}
private async void ButtonIsPressed(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new ficheAnime());
}
}

@ -3,7 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MangaMap"
xmlns:modeles="clr-namespace:MangaMap.Model"
x:Class="MangaMap.Views.homePage">
x:Class="MangaMap.Views.homePage"
xmlns:views="clr-namespace:MangaMap.Views.Composants">
<ContentPage.BindingContext>
<modeles:Manager/>
@ -32,11 +34,7 @@
HorizontalOptions="Center">
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Red"
Source="test2.png"
/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
@ -44,13 +42,9 @@
Source="test.jpg"
/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Blue"/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Purple"/>
<views:StyleBouton/>
</HorizontalStackLayout>
@ -58,22 +52,13 @@
Spacing="100"
HorizontalOptions="Center">
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Purple"
/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Green"/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Gray"/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Yellow"/>
<views:StyleBouton/>
</HorizontalStackLayout>
@ -81,22 +66,12 @@
Spacing="100"
HorizontalOptions="Center">
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Red"
/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Orange"/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Blue"/>
<views:StyleBouton/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Purple"/>
<views:StyleBouton/>
</HorizontalStackLayout>
@ -105,27 +80,18 @@
Spacing="100"
HorizontalOptions="Center">
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Purple"
/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Red"
/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Gray"/>
<views:StyleBouton/>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Yellow"/>
<views:StyleBouton/>
</HorizontalStackLayout>
<ListView x:Name="a1" ItemsSource="{Binding Utilisateurs}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>

@ -10,5 +10,6 @@ public partial class homePage : ContentPage
{
InitializeComponent();
a1.BindingContext = my_manager;
}
}
}
Loading…
Cancel
Save