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.
38 lines
1.0 KiB
38 lines
1.0 KiB
using Model.Classes;
|
|
using Model.Managers;
|
|
|
|
namespace Ohara;
|
|
|
|
public partial class ModalPersonnage : ContentPage
|
|
{
|
|
public Manager manager => (App.Current as App).manager;
|
|
public Personnage nouveauPerso = new Personnage("Personnage", 0, "", 0, 0, "", "", "");
|
|
public ModalPersonnage()
|
|
{
|
|
InitializeComponent();
|
|
BindingContext = nouveauPerso;
|
|
}
|
|
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
|
|
{
|
|
manager.AjouterPerso(nouveauPerso);
|
|
await Navigation.PopModalAsync();
|
|
}
|
|
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
|
|
{
|
|
await Navigation.PopModalAsync();
|
|
}
|
|
|
|
private async void ButtonImage_Clicked(object sender, EventArgs e)
|
|
{
|
|
var result = await FilePicker.PickAsync(new PickOptions
|
|
{
|
|
PickerTitle = "Choisissez une image ...",
|
|
FileTypes = FilePickerFileType.Images,
|
|
});
|
|
if (result != null)
|
|
{
|
|
var stream = result.FullPath;
|
|
nouveauPerso.Image = stream;
|
|
}
|
|
}
|
|
} |