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.
42 lines
1.2 KiB
42 lines
1.2 KiB
using Model.Stub;
|
|
using Plugin.Maui.Audio;
|
|
using System.Windows.Input;
|
|
using Model.Classes;
|
|
using Model.Managers;
|
|
|
|
namespace Ohara;
|
|
|
|
public partial class PageBestiaire : ContentPage
|
|
{
|
|
public Manager manager => (App.Current as App).manager;
|
|
|
|
public PageBestiaire()
|
|
{
|
|
InitializeComponent();
|
|
BindingContext = manager;
|
|
void OnTextChanged(object sender, EventArgs e)
|
|
{
|
|
SearchBar searchBar = (SearchBar)sender;
|
|
listeBest.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bestiaire.ToList()));
|
|
}
|
|
searchBar.TextChanged += OnTextChanged;
|
|
}
|
|
|
|
async void listeBest_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
if (e.CurrentSelection.Count == 0) return;
|
|
manager.SelectedItem = (Bestiaire)listeBest.SelectedItem;
|
|
await Navigation.PushAsync(new PageInfoBestiaire());
|
|
}
|
|
|
|
private void ContentPage_Appearing(object sender, EventArgs e)
|
|
{
|
|
manager.SelectedItem = null;
|
|
listeBest.SelectedItem = null;
|
|
}
|
|
|
|
private void ContentPage_Appearing_1(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
} |