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.
52 lines
1.1 KiB
52 lines
1.1 KiB
using M.Models;
|
|
using Microsoft.Maui.Controls.PlatformConfiguration;
|
|
using MusiLib.Model;
|
|
|
|
namespace MusiLib.Views;
|
|
|
|
|
|
public partial class Partition : ContentPage
|
|
{
|
|
|
|
public Manager MyManager => (App.Current as App).MyManager;
|
|
|
|
|
|
public Partition()
|
|
{
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
private void Play_Music(object sender, EventArgs e)
|
|
{
|
|
Button button = (Button)sender;
|
|
if (!IPlayMusic.isMusicBeginning)
|
|
{
|
|
IPlayMusic.beginMusic();
|
|
button.Text = "Pause";
|
|
}
|
|
else if(!IPlayMusic.isMusicPlaying)
|
|
{
|
|
IPlayMusic.playMusic();
|
|
button.Text = "Pause";
|
|
}
|
|
else
|
|
{
|
|
IPlayMusic.pauseMusic();
|
|
button.Text = "Jouer";
|
|
}
|
|
|
|
}
|
|
private void Stop_Music(object sender, EventArgs e)
|
|
{
|
|
IPlayMusic.stopMusic();
|
|
Button button = (Button)FindByName("play_music_button");
|
|
button.Text = "Jouer";
|
|
}
|
|
|
|
protected override bool OnBackButtonPressed()
|
|
{
|
|
IPlayMusic.stopMusic();
|
|
return base.OnBackButtonPressed();
|
|
}
|
|
} |