parent
ac35cbd296
commit
23c7e44322
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="PocketBook.AddBook">
|
||||
|
||||
<VerticalStackLayout>
|
||||
<Label Text="This is a very important message!" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
</toolkit:Popup>
|
@ -0,0 +1,11 @@
|
||||
using CommunityToolkit.Maui.Views;
|
||||
|
||||
namespace PocketBook;
|
||||
|
||||
public partial class AddBook : Popup
|
||||
{
|
||||
public AddBook()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,9 +1,14 @@
|
||||
<?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="PocketBook.BookChange">
|
||||
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
|
||||
<Image x:Name="imageName" WidthRequest="30" HeightRequest="30" />
|
||||
<Label x:Name="propertyName" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
|
||||
x:Class="PocketBook.BookChange"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
|
||||
<StackLayout Orientation="Horizontal" Margin="10,15,0,15">
|
||||
<Image x:Name="imageName" WidthRequest="30" HeightRequest="30">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label x:Name="propertyName" TextColor="{StaticResource Primary}" FontAttributes="Bold" VerticalOptions="Center" Margin="15,0,0,0"/>
|
||||
</StackLayout>
|
||||
</ContentView>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
@ -1,60 +1,68 @@
|
||||
namespace PocketBook;
|
||||
|
||||
public partial class Book
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string type { get; set; }
|
||||
public string auteur { get; set; }
|
||||
public string image { get; set; }
|
||||
|
||||
public Book(string name, string type,string auteur)
|
||||
{
|
||||
this.name = name;
|
||||
this.auteur = auteur;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Auteur
|
||||
{
|
||||
public string name { get; set; }
|
||||
public List<Book> books { get; set; }
|
||||
|
||||
public Auteur(string name)
|
||||
{
|
||||
this.name = name;
|
||||
books = new List<Book>
|
||||
{
|
||||
new Book("Buveur d'encre", "En lecture", name),
|
||||
new Book("Harry Potter et la pierre philosophale", "Non lu",name),
|
||||
new Book("Le Seigneur des anneaux", "En lecture", name),
|
||||
new Book("1984", "Terminé", name),
|
||||
new Book("Le Petit Prince", "Non lu", name)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public partial class TousPage : ContentPage
|
||||
{
|
||||
public List<Auteur> mesAuteurs { get; set; }
|
||||
public List<Book> books { get; set; }
|
||||
|
||||
public TousPage()
|
||||
{
|
||||
mesAuteurs = new List<Auteur>
|
||||
{
|
||||
new Auteur("J.K. Rowling"),
|
||||
new Auteur("J.R.R. Tolkien")
|
||||
};
|
||||
InitializeComponent();
|
||||
BindingContext=this;
|
||||
}
|
||||
public async void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.CurrentSelection.FirstOrDefault() is Book livreSelectionne)
|
||||
{
|
||||
await Navigation.PushAsync(new BookDetail(livreSelectionne));
|
||||
}
|
||||
}
|
||||
|
||||
using CommunityToolkit.Maui.Views;
|
||||
|
||||
namespace PocketBook;
|
||||
|
||||
public partial class Book
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string type { get; set; }
|
||||
public string auteur { get; set; }
|
||||
public string image { get; set; }
|
||||
|
||||
public Book(string name, string type,string auteur)
|
||||
{
|
||||
this.name = name;
|
||||
this.auteur = auteur;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Auteur
|
||||
{
|
||||
public string name { get; set; }
|
||||
public List<Book> books { get; set; }
|
||||
|
||||
public Auteur(string name)
|
||||
{
|
||||
this.name = name;
|
||||
books = new List<Book>
|
||||
{
|
||||
new Book("Buveur d'encre", "En lecture", name),
|
||||
new Book("Harry Potter et la pierre philosophale", "Non lu",name),
|
||||
new Book("Le Seigneur des anneaux", "En lecture", name),
|
||||
new Book("1984", "Terminé", name),
|
||||
new Book("Le Petit Prince", "Non lu", name)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public partial class TousPage : ContentPage
|
||||
{
|
||||
public List<Auteur> mesAuteurs { get; set; }
|
||||
public List<Book> books { get; set; }
|
||||
|
||||
public bool clicked=false;
|
||||
|
||||
public TousPage()
|
||||
{
|
||||
mesAuteurs = new List<Auteur>
|
||||
{
|
||||
new Auteur("J.K. Rowling"),
|
||||
new Auteur("J.R.R. Tolkien")
|
||||
};
|
||||
InitializeComponent();
|
||||
BindingContext=this;
|
||||
}
|
||||
public async void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.CurrentSelection.FirstOrDefault() is Book livreSelectionne)
|
||||
{
|
||||
await Navigation.PushAsync(new BookDetail(livreSelectionne));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnImageButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
var popup = new AddBook();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue