ADD : Avancement View

homepage-05-09
Lou BRODA 1 year ago
parent 6733ddb544
commit a9a5e562f4

@ -20,7 +20,7 @@
ContentTemplate="{DataTemplate view:DetailsLivreView}" ContentTemplate="{DataTemplate view:DetailsLivreView}"
Icon="bookmark_fill"/> Icon="bookmark_fill"/>
<ShellContent Title="Search" <ShellContent Title="Search"
ContentTemplate="{DataTemplate view:FiltrageDateView}" ContentTemplate="{DataTemplate view:TousView}"
Icon="magnifying_glass.png"/> Icon="magnifying_glass.png"/>
</TabBar> </TabBar>

@ -53,7 +53,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Model\" />
<Folder Include="ViewModel\" /> <Folder Include="ViewModel\" />
</ItemGroup> </ItemGroup>
@ -82,6 +81,9 @@
<MauiXaml Update="View\ContentViews\SeparatorEntireView.xaml"> <MauiXaml Update="View\ContentViews\SeparatorEntireView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="View\ContentViews\StarNotationView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="View\DetailsLivreView.xaml"> <MauiXaml Update="View\DetailsLivreView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LivreLand.Model
{
public class BookModel
{
public string Title { get; private set; }
public string Author { get; private set; }
public string State { get; private set; }
public int Rating { get; private set; }
public BookModel(string title, string author, string state, int rating)
{
Title = title;
Author = author;
State = state;
Rating = rating;
}
}
}

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="108" height="110">
<path d="M54,5 86,105 1,43H107L22,105" fill="#808080"/>
</svg>

After

Width:  |  Height:  |  Size: 167 B

@ -182,6 +182,12 @@
<Setter Property="FontAttributes" Value="Bold"/> <Setter Property="FontAttributes" Value="Bold"/>
</Style> </Style>
<Style TargetType="Label" x:Key="HomeTitle">
<Setter Property="TextColor" Value="{DynamicResource Black}"/>
<Setter Property="FontSize" Value="40"/>
<Setter Property="FontAttributes" Value="Bold"/>
</Style>
<Style TargetType="Label" x:Key="DetailsLivreTitle"> <Style TargetType="Label" x:Key="DetailsLivreTitle">
<Setter Property="TextColor" Value="{DynamicResource Black}"/> <Setter Property="TextColor" Value="{DynamicResource Black}"/>
<Setter Property="FontSize" Value="Small"/> <Setter Property="FontSize" Value="Small"/>

@ -4,9 +4,10 @@
xmlns:view="clr-namespace:LivreLand.View" xmlns:view="clr-namespace:LivreLand.View"
xmlns:contentView="clr-namespace:LivreLand.View.ContentViews" xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
x:Class="LivreLand.View.BibliothequeView" x:Class="LivreLand.View.BibliothequeView"
x:Name="this"
Title="BibliothequeView"> Title="BibliothequeView">
<Grid> <Grid BindingContext="{x:Reference this}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
<RowDefinition Height="10"/> <RowDefinition Height="10"/>
@ -28,20 +29,20 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Text="Mes Livres" <Label Text="Mes Livres"
FontAttributes="Bold"
FontSize="40"
Margin="10,0,0,0" Margin="10,0,0,0"
Style="{StaticResource HomeTitle}"
Grid.Row="0"/> Grid.Row="0"/>
<VerticalStackLayout BackgroundColor="{DynamicResource LightGray}" <VerticalStackLayout BackgroundColor="{DynamicResource LightGray}"
Grid.Row="2"> Grid.Row="2">
<contentView:SeparatorEntireView/> <contentView:SeparatorEntireView/>
<!--Tous--> <!--Tous-->
<contentView:HomeButtonView ButtonTitle="Tous" <contentView:HomeButtonView ButtonTitle="Tous"
ButtonIcon="tray_2_fill.png" ButtonIcon="tray_2_fill.png"
ButtonNumber="45"/> ButtonNumber="45"
ButtonCommand="{Binding FiltreAuteurCommand}"/>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>

@ -1,9 +1,24 @@
using System.Windows.Input;
namespace LivreLand.View; namespace LivreLand.View;
public partial class BibliothequeView : ContentPage public partial class BibliothequeView : ContentPage
{ {
public ICommand FiltreAuteurCommand { get; private set; }
public BibliothequeView() public BibliothequeView()
{ {
InitializeComponent(); InitializeComponent();
}
//Commandes navigation temporaires
FiltreAuteurCommand = new Command(
execute: () =>
{
App.Current.MainPage.Navigation.PushAsync(new FiltrageAuteurView());
},
canExecute: () =>
{
return true;
});
}
} }

@ -30,9 +30,9 @@
MaximumHeightRequest="15" MaximumHeightRequest="15"
MaximumWidthRequest="15" MaximumWidthRequest="15"
Grid.Column="6"/> Grid.Column="6"/>
<!--<Grid.GestureRecognizers> <Grid.GestureRecognizers>
<TapGestureRecognizer Command=""/> <TapGestureRecognizer Command="{Binding ButtonCommand}"/>
</Grid.GestureRecognizers>--> </Grid.GestureRecognizers>
</Grid> </Grid>
</ContentView> </ContentView>

@ -23,7 +23,7 @@ public partial class HomeButtonView : ContentView
set => SetValue(HomeButtonView.ButtonNumberProperty, value); set => SetValue(HomeButtonView.ButtonNumberProperty, value);
} }
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(nameof(ButtonCommand), typeof(Command), typeof(HomeButtonView), string.Empty); public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(nameof(ButtonCommand), typeof(Command), typeof(HomeButtonView));
public Command ButtonCommand public Command ButtonCommand
{ {
get => (Command)GetValue(HomeButtonView.ButtonCommandProperty); get => (Command)GetValue(HomeButtonView.ButtonCommandProperty);

@ -0,0 +1,24 @@
<?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="LivreLand.View.ContentViews.StarNotationView">
<HorizontalStackLayout Spacing="2">
<Image Source="star_fill.png"
HeightRequest="20"
WidthRequest="20"/>
<Image Source="star_fill.png"
HeightRequest="20"
WidthRequest="20"/>
<Image Source="star_fill.png"
HeightRequest="20"
WidthRequest="20"/>
<Image Source="star_fill.png"
HeightRequest="20"
WidthRequest="20"/>
<Image Source="star_fill.png"
HeightRequest="20"
WidthRequest="20"/>
</HorizontalStackLayout>
</ContentView>

@ -0,0 +1,9 @@
namespace LivreLand.View.ContentViews;
public partial class StarNotationView : ContentView
{
public StarNotationView()
{
InitializeComponent();
}
}

@ -45,7 +45,9 @@
<Label Text="La horde du contrevent" <Label Text="La horde du contrevent"
Grid.Column="2" Grid.Column="2"
Grid.Row="2"/> Grid.Row="0"/>
<contentView:StarNotationView Grid.Column="2"
Grid.Row="2"/>
</Grid> </Grid>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>

@ -1,11 +1,13 @@
<?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"
xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
x:Class="LivreLand.View.TousView" x:Class="LivreLand.View.TousView"
Title="TousView"> Title="TousView">
<Grid> <Grid>
<ScrollView> <ScrollView>
<CollectionView> <CollectionView ItemsSource="{Binding AllBooks}">
<CollectionView.GroupHeaderTemplate> <CollectionView.GroupHeaderTemplate>
<DataTemplate> <DataTemplate>
<Label Text="Alain Damasio"/> <Label Text="Alain Damasio"/>
@ -30,13 +32,13 @@
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
</Grid> </Grid>
<Label Text="La horde du contrevent" <Label Text="{Binding Title}"
Grid.Row="0"/> Grid.Row="0"/>
<Label Text="Alain Damasio" <Label Text="{Binding Author}"
Grid.Row="1"/> Grid.Row="1"/>
<Label Text="Non lu" <Label Text="{Binding State}"
Grid.Row="2"/> Grid.Row="2"/>
<contentView:StarNotationView Grid.Row="4"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>

@ -1,9 +1,19 @@
using LivreLand.Model;
namespace LivreLand.View; namespace LivreLand.View;
public partial class TousView : ContentPage public partial class TousView : ContentPage
{ {
public List<BookModel> AllBooks { get; set; } = new List<BookModel>()
{
new BookModel("Alain Damasio","La horde du contrevent","Non lu", 0),
new BookModel("Alain Damasio",".La zone du dehors","Terminé", 0),
new BookModel("Cixin Liu","L'équateur d'Einstein","Non lu", 0)
};
public TousView() public TousView()
{ {
BindingContext = this;
InitializeComponent(); InitializeComponent();
} }
} }
Loading…
Cancel
Save