You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
45 lines
1.5 KiB
using Model;
|
|
using Plugin.Maui.Audio;
|
|
|
|
namespace Ohara;
|
|
|
|
public partial class PageFavoris : ContentPage
|
|
{
|
|
public Manager manager => (App.Current as App).manager;
|
|
|
|
public PageFavoris()
|
|
{
|
|
InitializeComponent();
|
|
listeFavs.ItemsSource = manager.GetFavoris();
|
|
void OnTextChanged(object sender, EventArgs e)
|
|
{
|
|
SearchBar searchBar = (SearchBar)sender;
|
|
listeFavs.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris());
|
|
}
|
|
searchBar.TextChanged += OnTextChanged;
|
|
|
|
}
|
|
async void listeFavs_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
Type t = listeFavs.SelectedItem.GetType();
|
|
Console.WriteLine(t);
|
|
if (t.Equals(typeof(Bateau)))
|
|
await Navigation.PushAsync(new PageInfoBateau());
|
|
else if (t.Equals(typeof(Equipage)))
|
|
await Navigation.PushAsync(new PageInfoEquipage());
|
|
else if (t.Equals(typeof(Personnage)))
|
|
await Navigation.PushAsync(new PageInfoPersonnage());
|
|
else if (t.Equals(typeof(Ile)))
|
|
await Navigation.PushAsync(new PageInfoIle());
|
|
else if (t.Equals(typeof(FruitDuDemon)))
|
|
await Navigation.PushAsync(new PageInfoFdd());
|
|
else if (t.Equals(typeof(Bestiaire)))
|
|
await Navigation.PushAsync(new PageInfoBestiaire());
|
|
|
|
}
|
|
|
|
private void Button_Clicked(object sender, EventArgs e)
|
|
{
|
|
listeFavs.ItemsSource = manager.GetFavoris();
|
|
}
|
|
} |