using Model;
using System.Collections.ObjectModel;

namespace Linaris;

public partial class MainPage : ContentPage
{
	private ObservableCollection<Album> albums = (Application.Current as App).Manager.GetAlbums();

	public ObservableCollection<Album> Albums
	{
		get => albums;
	}

	public MainPage()
	{
		InitializeComponent();
		BindingContext = this;
    }

	async void GoToAlbum(object sender, EventArgs e)
	{
		if (sender is Image image)
        {
			if (image.BindingContext is Album album)
            {
                await Navigation.PushAsync(new AlbumPage(album));
            }
        }
    }
}

