master
Enzo 2 years ago
parent 1cfdc1ec6c
commit 49ac1cb105

Binary file not shown.

@ -1,7 +0,0 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\MVVM.sln",
"PreviewInSolutionExplorer": false
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

@ -15,7 +15,7 @@
</Tab>
<Tab Title="My Reading" Icon="bookmark_fill">
<ShellContent ContentTemplate="{DataTemplate local:Test}"/>
<ShellContent ContentTemplate="{DataTemplate local:Livres}"/>
</Tab>
<Tab Title="Search" Icon="magnifyingglass">
<ShellContent ContentTemplate="{DataTemplate local:Test}"/>

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MVVM.Classe
{
public class Livre
{
public string Image { get; set; }
public string Titre { get; set; }
public string Auteur { get; set; }
public string Note { get; set; }
public string Statut { get; set; }
public Livre() { }
}
}

@ -65,6 +65,9 @@
<MauiXaml Update="Pages\Bibliotheque.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\Component\Livre.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\DetailLivre.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -26,6 +26,9 @@
<MauiXaml Update="Pages\Bibliotheque.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Pages\Component\Livre.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Pages\DetailLivre.xaml">
<SubType>Designer</SubType>
</MauiXaml>

@ -21,6 +21,8 @@
<ToolbarItem IconImageSource="plus"/>
<!--<ToolbarItem Text="Scan" Order="Secondary"/>-->
</ContentPage.ToolbarItems>
<!-- Remplacer border par line-->
<ScrollView>

@ -0,0 +1,23 @@
<?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="MVVM.Pages.Component.Livre">
<Grid ColumnDefinitions="Auto,*">
<Image x:Name="Image" Grid.Column="0" Style="{StaticResource ImageLivre}" Source="null" />
<Grid Grid.Column="1" RowDefinitions="Auto,Auto,Auto,*,Auto">
<Label x:Name="Titre" Grid.Row="0" Text="Title"/>
<Label x:Name="Auteur" Grid.Row="1" Text="Auteur"/>
<Label Grid.Row="2" Text="Statut"/>
<Label Grid.Row="4" Text="Etoile"/>
</Grid>
</Grid>
</ContentView>

@ -0,0 +1,39 @@
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace MVVM.Pages.Component;
public partial class Livre : ContentView
{
public static readonly BindableProperty TitreCompProperty = BindableProperty.Create(nameof(TitreComp), typeof(string), typeof(Livre), string.Empty);
public static readonly BindableProperty ImageCompProperty = BindableProperty.Create(nameof(ImageComp), typeof(string), typeof(Livre), string.Empty);
public static readonly BindableProperty AuteurCompProperty = BindableProperty.Create(nameof(AuteurComp), typeof(string), typeof(Livre), string.Empty);
public string TitreComp
{
get => (string)GetValue(Livre.TitreCompProperty);
set => SetValue(Livre.TitreCompProperty, value);
}
public string ImageComp
{
get => (string)GetValue(Livre.ImageCompProperty);
set => SetValue(Livre.ImageCompProperty, value);
}
public string AuteurComp
{
get => (string)GetValue(Livre.AuteurCompProperty);
set => SetValue(Livre.AuteurCompProperty, value);
}
public Livre()
{
InitializeComponent();
Titre.SetBinding(Label.TextProperty, new Binding(nameof(TitreComp), source: this));
Image.SetBinding(Image.SourceProperty, new Binding(nameof(ImageComp), source: this));
Auteur.SetBinding(Label.TextProperty, new Binding(nameof(AuteurComp), source: this));
}
}

@ -1,8 +1,10 @@
<?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:Comp="clr-namespace:MVVM.Pages.Component"
x:Class="MVVM.Pages.Livres">
<ContentPage.ToolbarItems>
<ToolbarItem IconImageSource="plus"/>
<ToolbarItem Text="Mes livres"/>
@ -15,7 +17,53 @@
<ScrollView>
<Label Text="Contenu"/>
<VerticalStackLayout>
<StackLayout>
<VerticalStackLayout>
<Label Text="nom auteur"/>
<Comp:Livre ImageComp="onepiece1" AuteurComp="Alain Damasio"/>
</VerticalStackLayout>
</StackLayout>
<StackLayout>
<VerticalStackLayout>
<Comp:Livre ImageComp="onepiece" AuteurComp="Alain Damasio"/>
</VerticalStackLayout>
</StackLayout>
</VerticalStackLayout>
<!--
<CollectionView ItemsSource="{Binding tmp}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="Auto,*" BackgroundColor="Pink">
<Image Grid.Column="0" Style="{StaticResource ImageLivre}" Source="{Binding Image}"/>
<Grid Grid.Column="1" RowDefinitions="Auto,Auto,Auto,*,Auto">
<Label Grid.Row="0" Text="{Binding Titre}"/>
<Label Grid.Row="1" Text="{Binding Auteur}"/>
<Label Grid.Row="2" Text="{Binding Statut}"/>
<Label Grid.Row="4" Text="{Binding Note}"/>
</Grid>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
-->
</ScrollView>
</ContentPage>

@ -1,9 +1,20 @@
using MVVM.Classe;
using System.Collections.ObjectModel;
namespace MVVM.Pages;
public partial class Livres : ContentPage
{
public Livres()
public ObservableCollection<Livre> tmp { get; set; } = new ObservableCollection<Livre>();
public Livres()
{
InitializeComponent();
}
tmp.Add(new Livre() { Titre = "Enzo",Auteur = "Enzo" });
BindingContext = this;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

@ -438,5 +438,9 @@
<Setter Property="VerticalTextAlignment" Value="Center"/>
</Style>
<Style x:Key="ImageLivre" TargetType="Image">
<Setter Property="MaximumWidthRequest" Value="100"/>
</Style>
</ResourceDictionary>

@ -0,0 +1 @@
MMicrosoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmabilitytrue"System.AggressiveAttributeTrimmingtruefSystem.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerializationfalse'System.Diagnostics.Debugger.IsSupportedtrue2System.Diagnostics.Tracing.EventSource.IsSupportedfalseSystem.Globalization.Invariantfalse)System.Net.Http.EnableActivityPropagationfalse$System.Net.Http.UseNativeHttpHandlertrue4System.Reflection.NullabilityInfoContext.IsSupportedfalse9System.Resources.ResourceManager.AllowCustomResourceTypesfalse&System.Resources.UseSystemResourceKeysfalse<System.Runtime.InteropServices.BuiltInComInterop.IsSupportedfalseESystem.Runtime.Serialization.EnableUnsafeBinaryFormatterSerializationfalse&System.StartupHookProvider.IsSupportedfalse-System.Threading.Thread.EnableAutoreleasePooltrue-System.Text.Encoding.EnableUnsafeUTF7Encodingfalse

@ -0,0 +1,45 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"includedFrameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "7.0.10"
},
{
"name": "Microsoft.iOS",
"version": "16.4.7098"
},
{
"name": "Microsoft.Maui.Core",
"version": "**FromWorkload**"
},
{
"name": "Microsoft.Maui.Controls",
"version": "**FromWorkload**"
},
{
"name": "Microsoft.Maui.Essentials",
"version": "**FromWorkload**"
}
],
"configProperties": {
"Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability": true,
"System.AggressiveAttributeTrimming": true,
"System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization": false,
"System.Diagnostics.Debugger.IsSupported": true,
"System.Diagnostics.Tracing.EventSource.IsSupported": false,
"System.Globalization.Invariant": false,
"System.Net.Http.EnableActivityPropagation": false,
"System.Net.Http.UseNativeHttpHandler": true,
"System.Reflection.NullabilityInfoContext.IsSupported": false,
"System.Resources.ResourceManager.AllowCustomResourceTypes": false,
"System.Resources.UseSystemResourceKeys": false,
"System.Runtime.InteropServices.BuiltInComInterop.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false,
"System.StartupHookProvider.IsSupported": false,
"System.Threading.Thread.EnableAutoreleasePool": true,
"System.Text.Encoding.EnableUnsafeUTF7Encoding": false
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save