@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Runtime.CompilerServices ;
using System.Runtime.CompilerServices ;
using System.Windows.Input ;
using System.Windows.Input ;
using MyToolkitMVVM ;
using MyToolkitMVVM ;
using ViewModel ;
namespace PocketBook.Applicative_VM
namespace PocketBook.Applicative_VM
{
{
@ -11,6 +12,7 @@ namespace PocketBook.Applicative_VM
{
{
public ICommand ShowScanMenu { get ; private set ; }
public ICommand ShowScanMenu { get ; private set ; }
public ICommand ModalISBN { get ; private set ; }
public ICommand ModalISBN { get ; private set ; }
public ManagerVM Manager { get ; private set ; }
private bool scanMenuIsVisible ;
private bool scanMenuIsVisible ;
@ -20,15 +22,19 @@ namespace PocketBook.Applicative_VM
set = > SetProperty ( ref scanMenuIsVisible , value ) ;
set = > SetProperty ( ref scanMenuIsVisible , value ) ;
}
}
public ScanMenuVM ( )
public ScanMenuVM ( ManagerVM manager )
{
{
Manager = manager ;
ShowScanMenu = new Command ( ( ) = >
ShowScanMenu = new Command ( ( ) = >
{
{
ScanMenuIsVisible = ! ScanMenuIsVisible ;
ScanMenuIsVisible = ! ScanMenuIsVisible ;
} ) ;
} ) ;
ModalISBN = new Command (
ModalISBN = new Command (
async ( ) = > await App . Current . MainPage . DisplayPromptAsync ( "Ajout d'un livre par ISBN" , "Entrez l'ISBN présent sur votre livre pour l'ajouter à votre librarie" )
async ( ) = > {
) ;
string isbn = await App . Current . MainPage . DisplayPromptAsync ( "Ajout d'un livre par ISBN" , "Entrez l'ISBN présent sur votre livre pour l'ajouter à votre librarie" ) ;
if ( isbn ! = null ) { Manager . AddBookByISBN ( isbn ) ; }
}
) ; ;
}
}
}
}
}
}