Update (Front-End): début style

pull/2/head
lodufour1 2 years ago committed by Louis DUFOUR
parent 81b73e3c6d
commit 57798713bf

@ -5,10 +5,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:BookApp"
Shell.FlyoutBehavior="Disabled">
<TabBar>
<Tab Title="My Library"
Icon="books_vertical_fill.svg">
@ -29,5 +25,4 @@
<ShellContent ContentTemplate="{DataTemplate local:Pages.Filtrage}" />
</Tab>
</TabBar>
</Shell>

@ -67,8 +67,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="SimpleRatingControl.MAUI" Version="0.0.3" />
<PackageReference Include="SimpleRatingControl.MAUI" Version="0.1.0" />
</ItemGroup>
<ItemGroup>

@ -20,8 +20,8 @@
</ContentPage.ToolbarItems>
<StackLayout>
<Label FontSize="35" Padding="10" FontAttributes="Bold" >Mes livres</Label>
<BoxView HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<CollectionView ItemsSource="{Binding MyCollections1}" BackgroundColor="Gray">
<BoxView HeightRequest="1" BackgroundColor="#F9F9F9" VerticalOptions="End" />
<CollectionView ItemsSource="{Binding MyCollections1}" BackgroundColor="#F9F9F9">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid RowDefinitions="Auto" Margin="25,0,0,0">
@ -45,20 +45,26 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="2"
Text="{Binding Name}"
Text="{Binding Number}"
FontAttributes="Bold"
Padding="5"
VerticalOptions="Center"
Margin="0,0,30,0"/>
Margin="0,0,20,0"/>
<Button Grid.Column="2"
ImageSource="chevron_right.svg"
HeightRequest="35"
WidthRequest="35"
BackgroundColor="#F9F9F9"
Clicked="OnButtonClicked"
HorizontalOptions="End"/>
</Grid>
<!-- Si veiw cela vaudra peut-être le coup de faire une content view (équiavalent de user control) -->
<BoxView Grid.ColumnSpan="4" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />
<BoxView Grid.ColumnSpan="4" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End">
<BoxView.Triggers>
<DataTrigger TargetType="BoxView" Binding="{Binding IsLastItem}" Value="true">
<Setter Property="IsVisible" Value="False"/>
</DataTrigger>
</BoxView.Triggers>
</BoxView>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
@ -101,12 +107,10 @@
BackgroundColor="White"
HorizontalOptions="End"/>
</Grid>
<!-- Si veiw cela vaudra peut-être le coup de faire une content view (équiavalent de user control) -->
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<BoxView HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="EndAndExpand" />
</StackLayout>
<!--Pour l'opti on peut préciser le type du bind en aller tout en haut du fichier et faisent x:class ...-->
</ContentPage>

@ -9,14 +9,18 @@ namespace BookApp
{
public string Name { get; set; }
public string Icone { get; set; }
public int Number { get; set; }
public ObjetTemp(string name, string icone)
public ObjetTemp(string name, string icone, int number)
{
Name = name;
Icone = icone;
Number = number;
}
}
public bool IsLastItem { get; set; } //TO DO
public ObservableCollection<ObjetTemp> MyCollections1 { get; set; }
public ObservableCollection<ObjetTemp> MyCollections2 { get; set; }
@ -25,22 +29,23 @@ namespace BookApp
InitializeComponent();
MyCollections1 = new ObservableCollection<ObjetTemp>()
{
new ObjetTemp("Item1", "./Reources/Images/tray_2_fill.svg"),
new ObjetTemp("Item1", "./Reources/Images/person_badge_clock_fill.svg"),
new ObjetTemp("Item1", "./Reources/Images/arrow_forward.svg"),
new ObjetTemp("Item1", "./Reources/Images/eyeglasses.svg"),
new ObjetTemp("Item1", "./Reources/Images/heart_fill.svg"),
new ObjetTemp("Item1", "./Reources/Images/tag_fill.svg"),
new ObjetTemp("Item1", "./Reources/Images/tray_2_fill.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/person_badge_clock_fill.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/arrow_forward.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/eyeglasses.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/heart_fill.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/tag_fill.svg", 250),
};
MyCollections2 = new ObservableCollection<ObjetTemp>()
{
new ObjetTemp("Item1", "./Reources/Images/person_fill.svg"),
new ObjetTemp("Item1", "./Reources/Images/calendar.svg"),
new ObjetTemp("Item1", "./Reources/Images/sparkles.svg"),
new ObjetTemp("Item1", "./Reources/Images/person_fill.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/calendar.svg", 250),
new ObjetTemp("Item1", "./Reources/Images/sparkles.svg", 250),
};
BindingContext = this;
}
// Commande with view model pour le futur
async void OnButtonClicked(object sender, EventArgs args)
{
await Shell.Current.GoToAsync(nameof(Tous));

@ -1,27 +1,29 @@
using Microsoft.Extensions.Logging;
using SimpleRatingControlMaui;
namespace BookApp
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSimpleRatingControl()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}
using CommunityToolkit.Maui;
using Microsoft.Extensions.Logging;
using SimpleRatingControlMaui;
namespace BookApp
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.UseSimpleRatingControl()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}

@ -39,6 +39,7 @@
ImageSource="chevron_right.svg"
HeightRequest="35"
WidthRequest="35"
BackgroundColor="White"
HorizontalOptions="End"/>
</Grid>
<BoxView Margin="25,0,0,10" HeightRequest="1" BackgroundColor="LightGray" VerticalOptions="End" />

@ -2,8 +2,9 @@
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BookApp.Pages.Filtrage"
Title="Filtrage">
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="BookApp.Pages.Filtrage"
Title="Filtrage">
<Shell.BackButtonBehavior>
<BackButtonBehavior
IconOverride="chevron_left.svg"
@ -40,7 +41,11 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" HeightRequest="30"
WidthRequest="30" Source="Book.svg"/>
WidthRequest="30" Source="Book.svg">
<Image.Behaviors>
<toolkit:IconTintColorBehavior TintColor="Red" />
</Image.Behaviors>
</Image>
<Label Grid.Column="1" Margin="10,0,0,0" VerticalTextAlignment="Center" Text="LALALA"/>
<Label Grid.Column="2" VerticalTextAlignment="Center" Margin="0,0,40,0" HorizontalTextAlignment="End" Text="100"/>
<Button Grid.Column="2"

@ -4,13 +4,12 @@ namespace BookApp.Pages;
public partial class Filtrage : ContentPage
{
SearchBar searchBar = new SearchBar { Placeholder = "Search items..." };
public TousViewModel Data = new TousViewModel();
public Filtrage()
{
InitializeComponent();
BindingContext = Data;
}
}

@ -5,11 +5,6 @@
xmlns:usecase="clr-namespace:BookApp.UseCase"
xmlns:composants="clr-namespace:BookApp.Composants"
x:Class="BookApp.Tous">
<Shell.BackButtonBehavior>
<BackButtonBehavior
IconOverride="chevron_left.svg"
TextOverride="Tous"/>
</Shell.BackButtonBehavior>
<Shell.TitleView>
<Label
Text="Tous"
@ -21,15 +16,6 @@
FontSize="Medium"
HorizontalTextAlignment="Center"/>
</Shell.TitleView>
<ContentPage.ToolbarItems>
<ToolbarItem IconImageSource="plus_icone.svg" Priority="1" Order="Primary" StyleClass="PlusButton"/>
<ToolbarItem IconImageSource="arrow_up_arrow_down.svg" Priority="1" Order="Primary" />
</ContentPage.ToolbarItems>
<ContentPage.Resources>
<ResourceDictionary>
<usecase:RatingToStarImageConverter x:Key="RatingToStarConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<CollectionView ItemsSource="{Binding BookCollection}">
<CollectionView.ItemTemplate>

@ -10,6 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />

Loading…
Cancel
Save