ADD (Front-End): On pose les briques pour ce soir

pull/2/head
Louwar 2 years ago committed by Louis DUFOUR
parent 963db3b051
commit ae738ed108

@ -72,6 +72,9 @@
</ItemGroup>
<ItemGroup>
<Compile Update="Composants\ListItemView.xaml.cs">
<DependentUpon>ListItemView.xaml</DependentUpon>
</Compile>
<Compile Update="Composants\RatingView.xaml.cs">
<DependentUpon>RatingView.xaml</DependentUpon>
</Compile>
@ -81,6 +84,9 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="Composants\ListItemView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Composants\RatingView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -0,0 +1,49 @@
<?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="BookApp.Composants.ListItemView">
<Grid RowDefinitions="Auto" Margin="25,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0"
Source="{Binding Icone}"
HeightRequest="25"
WidthRequest="25"/>
<Label Grid.Column="1"
Text="{Binding Name}"
FontAttributes="Bold"
Padding="5"
VerticalOptions="Center"/>
<Grid Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0"
Text="{Binding Name}"
FontAttributes="Bold"
Padding="5"
VerticalOptions="Center"
Margin="0,0,30,0"/>
<Button Grid.Column="1"
ImageSource="chevron_right.svg"
HeightRequest="35"
WidthRequest="35"
Command="{Binding Path=BindingContext.ButtonCommand, Source={x:Reference Name=ListItemRoot}}"
HorizontalOptions="End"/>
</Grid>
<BoxView Grid.ColumnSpan="4"
HeightRequest="1"
BackgroundColor="LightGray"
VerticalOptions="End" />
</Grid>
</ContentView>

@ -0,0 +1,18 @@
namespace BookApp.Composants
{
public partial class ListItemView : ContentView
{
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(nameof(ButtonCommand), typeof(Command), typeof(ListItemView));
public Command ButtonCommand
{
get => (Command)GetValue(ButtonCommandProperty);
set => SetValue(ButtonCommandProperty, value);
}
public ListItemView()
{
InitializeComponent();
}
}
}

@ -4,6 +4,103 @@
x:Class="BookApp.Pages.DetailBook"
Title="Détails du livre">
<ContentPage.Content>
<StackLayout>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Grid>
<Image Grid.Column="0" Source="..."/>
<StackLayout>
<Label Text="La horde du coutrevant"/>
<Label Text="ssdqd"/>
</StackLayout>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Grid>
<Label Text="Info en ligne"/>
<Button Grid.Column="1"
ImageSource="chevron_right.svg"
HeightRequest="35"
WidthRequest="35"
Clicked="OnButtonClicked"
HorizontalOptions="End"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Label Text="Auteur"/>
<Label Text="sqdq"/>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Label Text="Maison d'édition"/>
<Label Text="sqdq"/>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Label Text="Résumer"/>
<Label Text="sqdq"/>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Label Text="Details"/>
<Grid>
<Label Text="Nombre de pages"/>
<Label Grid.Column="1" Text="500"/>
</Grid>
<Grid>
<Label Text="Langues"/>
<Label Grid.Column="1" Text="Français"/>
</Grid>
<Grid>
<Label Text="ISBN"/>
<Label Grid.Column="1" Text="48084095208"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Label Text="Status de lecture"/>
<Grid>
<Label Text="Status"/>
<Label Grid.Column="1" Text="non lu"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Label Text="biliothèque"/>
<Grid>
<Label Text="Ajouter le "/>
<Label Grid.Column="1" Text="10 aout 2023"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Grid click>
<Image Grid.Column="0" Source="..."/>
<Label Text="déplacer le livre"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Grid click>
<Image Grid.Column="0" Source="..."/>
<Label Text="Ajouter à la liste A lire plus tard"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Grid click>
<Image Grid.Column="0" Source="..."/>
<Label Text="changer le statu de lecture"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<Grid click>
<Image Grid.Column="0" Source="..."/>
<Label Text="préter le livre"/>
</Grid>
</StackLayout>
<!-- Gestion Star TODO -->
<StackLayout>
<StackLayout x:Name="StarLayout" Grid.Column="0" Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
<!-- Les étoiles seront ajoutées ici via le code-behind -->

@ -1,12 +1,48 @@
<?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:viewmodels="clr-namespace:BookApp.ViewModel"
xmlns:composants="clr-namespace:BookApp.Composants"
x:Class="BookApp.Pages.Filtrage"
Title="Filtrage">
<VerticalStackLayout>
<Shell.BackButtonBehavior>
<BackButtonBehavior
IconOverride="chevron_left.svg"
TextOverride="Tous"/>
</Shell.BackButtonBehavior>
<Shell.TitleView>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
Text="{Binding TitleSection}"
FontFamily="Strande2"
TextColor="White"
VerticalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
HeightRequest="50"
FontSize="Medium"
HorizontalTextAlignment="Center"/>
<!-- Date de publication ou auteur -->
</Shell.TitleView>
<ContentPage.ToolbarItems>
<ToolbarItem IconImageSource="plus_icone.svg" Priority="1" Order="Primary" />
<ToolbarItem IconImageSource="plus_icone.svg" Priority="1" Order="Primary" />
</ContentPage.ToolbarItems>
<ContentPage.BindingContext>
<viewmodels:SearchViewModel />
</ContentPage.BindingContext>
<StackLayout>
<SearchBar x:Name="searchBar"
SearchCommand="{Binding PerformSearch}"
SearchCommandParameter="{Binding Text, Source={x:Reference searchBar}}"/>
<ListView x:Name="searchResults"
ItemsSource="{Binding SearchResults}" />
<!-- <composants:ListItemView Icone="{Binding ImageBook}" Name="{Binding Name}" ButtonCommand="{Binding Press}" /> -->
</StackLayout>
</ContentPage>

@ -1,9 +1,15 @@
using BookApp.ViewModel;
namespace BookApp.Pages;
public partial class Filtrage : ContentPage
{
public TousViewModel Data = new TousViewModel();
public Filtrage()
{
InitializeComponent();
BindingContext = Data;
}
}

@ -0,0 +1,10 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2124_88468)">
<path d="M1 22.8164C1 23.7773 1.63281 24.1523 2.32422 24.1523C2.72266 24.1523 3.0625 23.918 3.50781 23.6484C4.79688 22.7695 6.39062 22.2305 8.01953 22.2422C9.70703 22.2539 11.3828 22.875 12.6953 24.1406C13.2109 24.6094 13.5859 24.7617 14.0195 24.7617C14.4414 24.7617 14.8281 24.6094 15.332 24.1406C16.6445 22.8867 18.3203 22.2539 20.0195 22.2422C21.6484 22.2305 23.2305 22.7695 24.5195 23.6484C24.9648 23.918 25.3047 24.1523 25.7148 24.1523C26.3945 24.1523 27.0273 23.7773 27.0273 22.8164V6.91406C27.0273 6.71484 27.0156 6.55078 26.8867 6.35156C25.8438 4.53516 23.1953 3 19.9727 3C17.418 3 15.2031 4.01953 14.0195 5.46094C12.8359 4.01953 10.6094 3 8.06641 3C4.83203 3 2.18359 4.53516 1.14062 6.35156C1.02344 6.55078 1 6.71484 1 6.91406V22.8164ZM2.88672 21.8203V7.18359C3.83594 5.8125 5.89844 4.88672 8.06641 4.88672C10.293 4.88672 12.2383 5.82422 13.0703 7.25391V22.0195C11.875 21.0703 10.0117 20.3555 8.06641 20.3555C6.02734 20.3555 4.12891 20.9297 2.88672 21.8203ZM14.957 22.0195V7.25391C15.7891 5.82422 17.7461 4.88672 19.9727 4.88672C22.1289 4.88672 24.1914 5.8125 25.1406 7.18359V21.8203C23.8984 20.9297 22 20.3555 19.9727 20.3555C18.0156 20.3555 16.1523 21.0703 14.957 22.0195Z" fill="black" fill-opacity="0.85"/>
</g>
<defs>
<clipPath id="clip0_2124_88468">
<rect width="26.0273" height="21.7852" fill="white" transform="translate(1 3)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using BookApp.Data;
using System.Windows.Input;
using BookApp.Model;
using System.Collections.ObjectModel;
namespace BookApp.ViewModel
{
public class SearchViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public ObservableCollection<Book> BookCollection { get; set; } =
new ObservableCollection<Book>();
protected virtual void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/*
public ICommand PerformSearch => new Command<string>((string query) =>
{
//SearchResults = DataService.GetSearchResults(query);
SearchResults = BookCollection = BookCollection.Select(query);
});
private List<string> searchResults = BookCollection.GetStubData();
public List<string> SearchResults
{
get
{
return searchResults;
}
set
{
searchResults = value;
NotifyPropertyChanged();
}
}*/
}
}

@ -0,0 +1,10 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2124_88468)">
<path d="M1 22.8164C1 23.7773 1.63281 24.1523 2.32422 24.1523C2.72266 24.1523 3.0625 23.918 3.50781 23.6484C4.79688 22.7695 6.39062 22.2305 8.01953 22.2422C9.70703 22.2539 11.3828 22.875 12.6953 24.1406C13.2109 24.6094 13.5859 24.7617 14.0195 24.7617C14.4414 24.7617 14.8281 24.6094 15.332 24.1406C16.6445 22.8867 18.3203 22.2539 20.0195 22.2422C21.6484 22.2305 23.2305 22.7695 24.5195 23.6484C24.9648 23.918 25.3047 24.1523 25.7148 24.1523C26.3945 24.1523 27.0273 23.7773 27.0273 22.8164V6.91406C27.0273 6.71484 27.0156 6.55078 26.8867 6.35156C25.8438 4.53516 23.1953 3 19.9727 3C17.418 3 15.2031 4.01953 14.0195 5.46094C12.8359 4.01953 10.6094 3 8.06641 3C4.83203 3 2.18359 4.53516 1.14062 6.35156C1.02344 6.55078 1 6.71484 1 6.91406V22.8164ZM2.88672 21.8203V7.18359C3.83594 5.8125 5.89844 4.88672 8.06641 4.88672C10.293 4.88672 12.2383 5.82422 13.0703 7.25391V22.0195C11.875 21.0703 10.0117 20.3555 8.06641 20.3555C6.02734 20.3555 4.12891 20.9297 2.88672 21.8203ZM14.957 22.0195V7.25391C15.7891 5.82422 17.7461 4.88672 19.9727 4.88672C22.1289 4.88672 24.1914 5.8125 25.1406 7.18359V21.8203C23.8984 20.9297 22 20.3555 19.9727 20.3555C18.0156 20.3555 16.1523 21.0703 14.957 22.0195Z" fill="black" fill-opacity="0.85"/>
</g>
<defs>
<clipPath id="clip0_2124_88468">
<rect width="26.0273" height="21.7852" fill="white" transform="translate(1 3)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Loading…
Cancel
Save