ADD : Navigation & Last Views

homepage-05-09
Lou BRODA 1 year ago
parent 4cdfd6a42d
commit aab6b54ecd

@ -58,6 +58,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="View\ALirePlusTardView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="View\BibliothequeView.xaml"> <MauiXaml Update="View\BibliothequeView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
@ -103,6 +106,9 @@
<MauiXaml Update="View\EmpruntsPretsView.xaml"> <MauiXaml Update="View\EmpruntsPretsView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="View\FavorisView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="View\FiltrageAuteurView.xaml"> <MauiXaml Update="View\FiltrageAuteurView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
@ -118,6 +124,9 @@
<MauiXaml Update="View\HeaderPage.xaml"> <MauiXaml Update="View\HeaderPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="View\StatutLectureView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="View\TousView.xaml"> <MauiXaml Update="View\TousView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

@ -0,0 +1,120 @@
<?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"
xmlns:view="clr-namespace:LivreLand.View"
xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
x:Class="LivreLand.View.ALirePlusTardView"
Title="ALirePlusTardView">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<view:HeaderPage HeaderTitle="A lire plus tard"
HeaderBackButtonText="Mes livres"
HeaderPlusButtonVisible="True"
HeaderSwitchButtonVisible="True"
Grid.Row="0"/>
<ScrollView Grid.Row="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource HeaderGray}, Dark={StaticResource Gray900}}"
Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="A lire plus tard"
VerticalOptions="Center"
Style="{StaticResource HeaderCollectionViewText}"
Grid.Column="1"/>
</Grid>
<CollectionView ItemsSource="{Binding ALirePlusTardBooks}"
SelectionMode="Single"
SelectionChanged="OnSelectionChanged"
Grid.Row="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Margin="10"
Spacing="20">
<VisualStateManager.VisualStateGroups x:Name="SelectionStates">
<VisualStateGroup>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border Padding="-5,-5,-5,1"
Margin="10,0,0,0"
HeightRequest="100"
WidthRequest="62"
HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3"
Grid.Column="0"
Grid.RowSpan="5">
<Border HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3">
<Image Source="couverture_la_horde_du_contrevent.png"
Aspect="AspectFill"
Grid.Column="0"
Grid.RowSpan="5"/>
</Border>
</Border>
<Label Text="{Binding Title}"
Style="{StaticResource MasterTitleBookText}"
Grid.Column="2"
Grid.Row="0"/>
<Label Text="{Binding Author}"
Style="{StaticResource MasterAuthorBookText}"
Grid.Column="2"
Grid.Row="1"/>
<Label Text="{Binding State}"
Style="{StaticResource MasterStateBookText}"
Grid.Column="2"
Grid.Row="2"/>
<contentView:StarNotationView Grid.Column="2"
Grid.Row="4"/>
</Grid>
<contentView:SeparatorCutStartView/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView>
<Grid HorizontalOptions="End"
VerticalOptions="Center"
Grid.RowSpan="3">
<contentView:AlphabetVerticalMenuView/>
</Grid>
</Grid>
</ContentPage>

@ -0,0 +1,22 @@
using LivreLand.Model;
namespace LivreLand.View;
public partial class ALirePlusTardView : ContentPage
{
public List<BookModel> ALirePlusTardBooks { get; set; } = new List<BookModel>()
{
new BookModel("La horde du contrevent","Alain Damasio","Non lu", 0),
};
public ALirePlusTardView()
{
BindingContext = this;
InitializeComponent();
}
void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView());
}
}

@ -7,6 +7,7 @@
x:Class="LivreLand.View.BibliothequeView" x:Class="LivreLand.View.BibliothequeView"
x:Name="this" x:Name="this"
Title="BibliothequeView"> Title="BibliothequeView">
<ContentPage.Behaviors> <ContentPage.Behaviors>
<toolkit:StatusBarBehavior> <toolkit:StatusBarBehavior>
<toolkit:StatusBarBehavior.StatusBarColor> <toolkit:StatusBarBehavior.StatusBarColor>
@ -53,7 +54,8 @@
ButtonIcon="tray_2_fill.png" ButtonIcon="tray_2_fill.png"
ButtonNumber="45" ButtonNumber="45"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding TousNavigationCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -62,7 +64,8 @@
ButtonIcon="person_badge_clock_fill.png" ButtonIcon="person_badge_clock_fill.png"
ButtonNumber="1" ButtonNumber="1"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding EmpruntsPretsNavigationCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -70,7 +73,8 @@
<contentView:HomeButtonView ButtonTitle="À lire plus tard" <contentView:HomeButtonView ButtonTitle="À lire plus tard"
ButtonIcon="arrow_forward.png" ButtonIcon="arrow_forward.png"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding ALirePlusTardNavigationCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -78,7 +82,8 @@
<contentView:HomeButtonView ButtonTitle="Statut de lecture" <contentView:HomeButtonView ButtonTitle="Statut de lecture"
ButtonIcon="eyeglasses.png" ButtonIcon="eyeglasses.png"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding StatutLectureNavigationCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -86,7 +91,8 @@
<contentView:HomeButtonView ButtonTitle="Favoris" <contentView:HomeButtonView ButtonTitle="Favoris"
ButtonIcon="heart_fill.png" ButtonIcon="heart_fill.png"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding FavorisNavigationCommand}"/>
<contentView:SeparatorEntireView/> <contentView:SeparatorEntireView/>
</VerticalStackLayout> </VerticalStackLayout>
@ -107,7 +113,8 @@
<contentView:HomeButtonView ButtonTitle="Auteur" <contentView:HomeButtonView ButtonTitle="Auteur"
ButtonIcon="person_fill.png" ButtonIcon="person_fill.png"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding AuteurNavigationCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -115,7 +122,8 @@
<contentView:HomeButtonView ButtonTitle="Date de publication" <contentView:HomeButtonView ButtonTitle="Date de publication"
ButtonIcon="calendar.png" ButtonIcon="calendar.png"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding DatePublicationNavigationCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -123,7 +131,8 @@
<contentView:HomeButtonView ButtonTitle="Note" <contentView:HomeButtonView ButtonTitle="Note"
ButtonIcon="sparkles.png" ButtonIcon="sparkles.png"
ButtonRedIconVisible="False" ButtonRedIconVisible="False"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="True"
ButtonTappedCommand="{Binding NoteNavigationCommand}"/>
<contentView:SeparatorEntireView/> <contentView:SeparatorEntireView/>
</VerticalStackLayout> </VerticalStackLayout>

@ -4,8 +4,66 @@ namespace LivreLand.View;
public partial class BibliothequeView : ContentPage public partial class BibliothequeView : ContentPage
{ {
public BibliothequeView() public ICommand TousNavigationCommand { get; }
public ICommand EmpruntsPretsNavigationCommand { get; }
public ICommand ALirePlusTardNavigationCommand { get; }
public ICommand StatutLectureNavigationCommand { get; }
public ICommand FavorisNavigationCommand { get; }
public ICommand AuteurNavigationCommand { get; }
public ICommand DatePublicationNavigationCommand { get; }
public ICommand NoteNavigationCommand { get; }
public BibliothequeView()
{ {
InitializeComponent(); TousNavigationCommand = new Command(TousNavigation);
EmpruntsPretsNavigationCommand = new Command(EmpruntsPretsNavigation);
ALirePlusTardNavigationCommand = new Command(ALirePlusTardNavigation);
StatutLectureNavigationCommand = new Command(StatutLectureNavigation);
FavorisNavigationCommand = new Command(FavorisNavigation);
AuteurNavigationCommand = new Command(AuteurNavigation);
DatePublicationNavigationCommand = new Command(DatePublicationNavigation);
NoteNavigationCommand = new Command(NoteNavigation);
InitializeComponent();
}
//Gestion de la navigation temporaire
private async void TousNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new TousView());
}
private async void EmpruntsPretsNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new EmpruntsPretsView());
}
private async void ALirePlusTardNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new ALirePlusTardView());
}
private async void StatutLectureNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new StatutLectureView());
}
private async void AuteurNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new FiltrageAuteurView());
}
private async void FavorisNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new FavorisView());
}
private async void DatePublicationNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new FiltrageDateView());
}
private async void NoteNavigation()
{
await App.Current.MainPage.Navigation.PushAsync(new FiltrageNoteView());
} }
} }

@ -51,6 +51,9 @@
<toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/> <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/>
</Image.Behaviors> </Image.Behaviors>
</Image> </Image>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ButtonTappedCommand}"/>
</Grid.GestureRecognizers>
</Grid> </Grid>
</ContentView> </ContentView>

@ -1,4 +1,5 @@
using Microsoft.Maui.Graphics; using Microsoft.Maui.Graphics;
using System.Windows.Input;
namespace LivreLand.View.ContentViews; namespace LivreLand.View.ContentViews;
@ -39,6 +40,13 @@ public partial class HomeButtonView : ContentView
set => SetValue(HomeButtonView.ButtonBlackIconVisibleProperty, value); set => SetValue(HomeButtonView.ButtonBlackIconVisibleProperty, value);
} }
public static readonly BindableProperty ButtonTappedCommandProperty = BindableProperty.Create(nameof(ButtonTappedCommand), typeof(ICommand), typeof(HomeButtonView));
public ICommand ButtonTappedCommand
{
get { return (ICommand)GetValue(ButtonTappedCommandProperty); }
set { SetValue(ButtonTappedCommandProperty, value); }
}
public HomeButtonView() public HomeButtonView()
{ {
InitializeComponent(); InitializeComponent();

@ -15,7 +15,7 @@
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<view:HeaderPage HeaderTitle="Tous" <view:HeaderPage HeaderTitle="En prêt"
HeaderBackButtonText="Mes livres" HeaderBackButtonText="Mes livres"
HeaderPlusButtonVisible="True" HeaderPlusButtonVisible="True"
HeaderSwitchButtonVisible="True" HeaderSwitchButtonVisible="True"

@ -0,0 +1,120 @@
<?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"
xmlns:view="clr-namespace:LivreLand.View"
xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
x:Class="LivreLand.View.FavorisView"
Title="FavorisView">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<view:HeaderPage HeaderTitle="Favoris"
HeaderBackButtonText="Mes livres"
HeaderPlusButtonVisible="True"
HeaderSwitchButtonVisible="True"
Grid.Row="0"/>
<ScrollView Grid.Row="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource HeaderGray}, Dark={StaticResource Gray900}}"
Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="Favoris"
VerticalOptions="Center"
Style="{StaticResource HeaderCollectionViewText}"
Grid.Column="1"/>
</Grid>
<CollectionView ItemsSource="{Binding FavorisBooks}"
SelectionMode="Single"
SelectionChanged="OnSelectionChanged"
Grid.Row="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Margin="10"
Spacing="20">
<VisualStateManager.VisualStateGroups x:Name="SelectionStates">
<VisualStateGroup>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border Padding="-5,-5,-5,1"
Margin="10,0,0,0"
HeightRequest="100"
WidthRequest="62"
HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3"
Grid.Column="0"
Grid.RowSpan="5">
<Border HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3">
<Image Source="couverture_la_horde_du_contrevent.png"
Aspect="AspectFill"
Grid.Column="0"
Grid.RowSpan="5"/>
</Border>
</Border>
<Label Text="{Binding Title}"
Style="{StaticResource MasterTitleBookText}"
Grid.Column="2"
Grid.Row="0"/>
<Label Text="{Binding Author}"
Style="{StaticResource MasterAuthorBookText}"
Grid.Column="2"
Grid.Row="1"/>
<Label Text="{Binding State}"
Style="{StaticResource MasterStateBookText}"
Grid.Column="2"
Grid.Row="2"/>
<contentView:StarNotationView Grid.Column="2"
Grid.Row="4"/>
</Grid>
<contentView:SeparatorCutStartView/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView>
<Grid HorizontalOptions="End"
VerticalOptions="Center"
Grid.RowSpan="3">
<contentView:AlphabetVerticalMenuView/>
</Grid>
</Grid>
</ContentPage>

@ -0,0 +1,23 @@
using LivreLand.Model;
namespace LivreLand.View;
public partial class FavorisView : ContentPage
{
public List<BookModel> FavorisBooks { get; set; } = new List<BookModel>()
{
new BookModel("La zone du dehors","Alain Damasio","Terminé", 0),
new BookModel("Le problème à trois corps","Cixin Liu","Terminé", 0)
};
public FavorisView()
{
BindingContext = this;
InitializeComponent();
}
void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView());
}
}

@ -38,8 +38,8 @@
<contentView:HomeButtonView ButtonTitle="1 étoile" <contentView:HomeButtonView ButtonTitle="1 étoile"
ButtonIcon="book.png" ButtonIcon="book.png"
ButtonNumber="2" ButtonNumber="2"
ButtonRedIconVisible="False" ButtonRedIconVisible="True"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="False"/>
<contentView:SeparatorBigCutStartView/> <contentView:SeparatorBigCutStartView/>
@ -47,8 +47,8 @@
<contentView:HomeButtonView ButtonTitle="2 étoiles" <contentView:HomeButtonView ButtonTitle="2 étoiles"
ButtonIcon="book.png" ButtonIcon="book.png"
ButtonNumber="2" ButtonNumber="2"
ButtonRedIconVisible="False" ButtonRedIconVisible="True"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="False"/>
<contentView:SeparatorBigCutStartView/> <contentView:SeparatorBigCutStartView/>
@ -56,8 +56,8 @@
<contentView:HomeButtonView ButtonTitle="3 étoiles" <contentView:HomeButtonView ButtonTitle="3 étoiles"
ButtonIcon="book.png" ButtonIcon="book.png"
ButtonNumber="2" ButtonNumber="2"
ButtonRedIconVisible="False" ButtonRedIconVisible="True"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="False"/>
<contentView:SeparatorBigCutStartView/> <contentView:SeparatorBigCutStartView/>
@ -65,8 +65,8 @@
<contentView:HomeButtonView ButtonTitle="4 étoiles" <contentView:HomeButtonView ButtonTitle="4 étoiles"
ButtonIcon="book.png" ButtonIcon="book.png"
ButtonNumber="2" ButtonNumber="2"
ButtonRedIconVisible="False" ButtonRedIconVisible="True"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="False"/>
<contentView:SeparatorBigCutStartView/> <contentView:SeparatorBigCutStartView/>
@ -74,8 +74,8 @@
<contentView:HomeButtonView ButtonTitle="5 étoiles" <contentView:HomeButtonView ButtonTitle="5 étoiles"
ButtonIcon="book.png" ButtonIcon="book.png"
ButtonNumber="2" ButtonNumber="2"
ButtonRedIconVisible="False" ButtonRedIconVisible="True"
ButtonBlackIconVisible="True"/> ButtonBlackIconVisible="False"/>
<contentView:SeparatorBigCutStartView/> <contentView:SeparatorBigCutStartView/>
</VerticalStackLayout> </VerticalStackLayout>

@ -0,0 +1,205 @@
<?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"
xmlns:view="clr-namespace:LivreLand.View"
xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
x:Class="LivreLand.View.StatutLectureView"
Title="StatutLectureView">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<view:HeaderPage HeaderTitle="Statut de lecture"
HeaderBackButtonText="Mes livres"
HeaderPlusButtonVisible="True"
HeaderSwitchButtonVisible="True"
Grid.Row="0"/>
<contentView:SearchBarView Grid.Row="2"/>
<ScrollView Grid.Row="4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="40"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource HeaderGray}, Dark={StaticResource Gray900}}"
Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="Non lus"
VerticalOptions="Center"
Style="{StaticResource HeaderCollectionViewText}"
Grid.Column="1"/>
</Grid>
<CollectionView ItemsSource="{Binding NonLuBooks}"
SelectionMode="Single"
SelectionChanged="OnSelectionChanged"
Grid.Row="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Margin="10"
Spacing="20">
<VisualStateManager.VisualStateGroups x:Name="SelectionStates">
<VisualStateGroup>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border Padding="-5,-5,-5,1"
Margin="10,0,0,0"
HeightRequest="100"
WidthRequest="62"
HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3"
Grid.Column="0"
Grid.RowSpan="5">
<Border HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3">
<Image Source="couverture_la_horde_du_contrevent.png"
Aspect="AspectFill"
Grid.Column="0"
Grid.RowSpan="5"/>
</Border>
</Border>
<Label Text="{Binding Title}"
Style="{StaticResource MasterTitleBookText}"
Grid.Column="2"
Grid.Row="0"/>
<Label Text="{Binding Author}"
Style="{StaticResource MasterAuthorBookText}"
Grid.Column="2"
Grid.Row="1"/>
<Label Text="{Binding State}"
Style="{StaticResource MasterStateBookText}"
Grid.Column="2"
Grid.Row="2"/>
<contentView:StarNotationView Grid.Column="2"
Grid.Row="4"/>
</Grid>
<contentView:SeparatorCutStartView/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource HeaderGray}, Dark={StaticResource Gray900}}"
Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="Terminés"
VerticalOptions="Center"
Style="{StaticResource HeaderCollectionViewText}"
Grid.Column="1"/>
</Grid>
<CollectionView ItemsSource="{Binding TermineBooks}"
SelectionMode="Single"
SelectionChanged="OnSelectionChanged"
Grid.Row="6">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Margin="10"
Spacing="20">
<VisualStateManager.VisualStateGroups x:Name="SelectionStates">
<VisualStateGroup>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border Padding="-5,-5,-5,1"
Margin="10,0,0,0"
HeightRequest="100"
WidthRequest="62"
HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3"
Grid.Column="0"
Grid.RowSpan="5">
<Border HorizontalOptions="Center"
Stroke="{StaticResource Gray}"
StrokeShape="RoundRectangle 3"
StrokeThickness="3">
<Image Source="couverture_la_horde_du_contrevent.png"
Aspect="AspectFill"
Grid.Column="0"
Grid.RowSpan="5"/>
</Border>
</Border>
<Label Text="{Binding Title}"
Style="{StaticResource MasterTitleBookText}"
Grid.Column="2"
Grid.Row="0"/>
<Label Text="{Binding Author}"
Style="{StaticResource MasterAuthorBookText}"
Grid.Column="2"
Grid.Row="1"/>
<Label Text="{Binding State}"
Style="{StaticResource MasterStateBookText}"
Grid.Column="2"
Grid.Row="2"/>
<contentView:StarNotationView Grid.Column="2"
Grid.Row="4"/>
</Grid>
<contentView:SeparatorCutStartView/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView>
</Grid>
</ContentPage>

@ -0,0 +1,30 @@
using LivreLand.Model;
namespace LivreLand.View;
public partial class StatutLectureView : ContentPage
{
public List<BookModel> NonLuBooks { get; set; } = new List<BookModel>()
{
new BookModel("La horde du contrevent","Alain Damasio","Non lu", 0),
};
public List<BookModel> TermineBooks { get; set; } = new List<BookModel>()
{
new BookModel("La zone du dehors","Alain Damasio","Terminé", 0),
new BookModel("L'équateur d'Einstein","Cixin Liu","Terminé", 0),
new BookModel("La forêt sombre","Cixin Liu","Terminé", 0),
new BookModel("Le problème à trois corps","Cixin Liu","Terminé", 0)
};
public StatutLectureView()
{
BindingContext = this;
InitializeComponent();
}
void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView());
}
}
Loading…
Cancel
Save