parent
963db3b051
commit
ae738ed108
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,48 @@
|
|||||||
<?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:viewmodels="clr-namespace:BookApp.ViewModel"
|
||||||
|
xmlns:composants="clr-namespace:BookApp.Composants"
|
||||||
x:Class="BookApp.Pages.Filtrage"
|
x:Class="BookApp.Pages.Filtrage"
|
||||||
Title="Filtrage">
|
Title="Filtrage">
|
||||||
<VerticalStackLayout>
|
|
||||||
|
<Shell.BackButtonBehavior>
|
||||||
|
<BackButtonBehavior
|
||||||
|
IconOverride="chevron_left.svg"
|
||||||
|
TextOverride="Tous"/>
|
||||||
|
</Shell.BackButtonBehavior>
|
||||||
|
|
||||||
|
<Shell.TitleView>
|
||||||
<Label
|
<Label
|
||||||
Text="Welcome to .NET MAUI!"
|
Text="{Binding TitleSection}"
|
||||||
VerticalOptions="Center"
|
FontFamily="Strande2"
|
||||||
HorizontalOptions="Center" />
|
TextColor="White"
|
||||||
</VerticalStackLayout>
|
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>
|
</ContentPage>
|
@ -1,9 +1,15 @@
|
|||||||
|
using BookApp.ViewModel;
|
||||||
|
|
||||||
namespace BookApp.Pages;
|
namespace BookApp.Pages;
|
||||||
|
|
||||||
public partial class Filtrage : ContentPage
|
public partial class Filtrage : ContentPage
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public TousViewModel Data = new TousViewModel();
|
||||||
public Filtrage()
|
public Filtrage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
BindingContext = Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in new issue