Added better navigation and modification in AppShell.xaml

dictionnaire
Matheo HERSAN 2 years ago
parent a68277586f
commit 8b12a07fb8

@ -5,9 +5,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MangaMap" xmlns:local="clr-namespace:MangaMap"
xmlns:Views="clr-namespace:MangaMap.Views" xmlns:Views="clr-namespace:MangaMap.Views"
Shell.FlyoutBehavior="Flyout" Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="False"> Shell.NavBarIsVisible="False">
<TabBar>
<ShellContent <ShellContent
Title="Home" Title="Home"
ContentTemplate="{DataTemplate Views:homePage}" ContentTemplate="{DataTemplate Views:homePage}"
@ -29,8 +30,14 @@
Title="Liste" Title="Liste"
ContentTemplate="{DataTemplate Views:listPage}" /> ContentTemplate="{DataTemplate Views:listPage}" />
</TabBar>
<FlyoutItem>
<ShellContent <ShellContent
Title="Fiche Exemple" Title="Fiche Exemple"
ContentTemplate="{DataTemplate Views:ficheAnime}" /> ContentTemplate="{DataTemplate Views:ficheAnime}" />
</FlyoutItem>
</Shell> </Shell>

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

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