|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
using Android.Service.Voice;
|
|
|
|
|
using Microsoft.Maui.Controls.PlatformConfiguration;
|
|
|
|
|
using MusiLib.Model;
|
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
@ -28,9 +27,9 @@ public partial class PartitionView : ContentPage
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
IdTab = id;
|
|
|
|
|
Part.BindingContext = MyManager.partitions[IdTab];
|
|
|
|
|
Part2.BindingContext = MyManager;
|
|
|
|
|
|
|
|
|
|
InitializeButton();
|
|
|
|
|
ChargerPartitionsSimilaires();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Play_Music(object sender, EventArgs e)
|
|
|
|
@ -130,6 +129,59 @@ public partial class PartitionView : ContentPage
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ChargerPartitionsSimilaires()
|
|
|
|
|
{
|
|
|
|
|
string auteur = MyManager.partitions[IdTab].Auteur;
|
|
|
|
|
string instrument = MyManager.partitions[IdTab].Instrument;
|
|
|
|
|
|
|
|
|
|
var partitionsSimilaires = MyManager.partitions.Where(p => p.Auteur.ToLower() == auteur.ToLower() ||
|
|
|
|
|
p.Instrument.ToLower() == instrument.ToLower()).ToList();
|
|
|
|
|
|
|
|
|
|
uint i = 1;
|
|
|
|
|
|
|
|
|
|
foreach (var partition in partitionsSimilaires)
|
|
|
|
|
{
|
|
|
|
|
++i;
|
|
|
|
|
if(i>9)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
int indicePartition = MyManager.partitions.IndexOf(partition);
|
|
|
|
|
|
|
|
|
|
var imageButton = new ImageButton
|
|
|
|
|
{
|
|
|
|
|
Source = partition.Image[0],
|
|
|
|
|
HeightRequest = 80,
|
|
|
|
|
WidthRequest = 80,
|
|
|
|
|
AutomationId = indicePartition.ToString()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
imageButton.Clicked += GoToPartitionButton;
|
|
|
|
|
|
|
|
|
|
PartitionsSimilairesStackLayout.Children.Add(imageButton);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void GoToPartitionButton(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IAllowClick.AllowTap) return;
|
|
|
|
|
else IAllowClick.AllowTap = false;
|
|
|
|
|
|
|
|
|
|
var button = (ImageButton)sender;
|
|
|
|
|
var idAutomation = button.AutomationId;
|
|
|
|
|
|
|
|
|
|
if (int.TryParse(idAutomation, out int id))
|
|
|
|
|
{
|
|
|
|
|
Navigation.PushAsync(new PartitionView(id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IAllowClick.ResumeTap();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void AddFavoriButton(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ImageButton button = (ImageButton)sender;
|
|
|
|
|