Esempio n. 1
0
        public async Task <TResult> ShowModalDialogAsync <TViewModel, TResult>(object args) where TViewModel : IResultDialogViewModel <TResult>
        {
            IResultDialogViewModel <TResult> vm = GetViewModel <TViewModel, TResult>(args);
            LcarsModalDialog dialog             = ResolveModalDialogForViewModel(vm);

            _semaphore.Wait();
            await dialog.OpenAsync();

            _semaphore.Release();

            return(vm.Result);
        }
Esempio n. 2
0
 private static LcarsModalDialog ResolveModalDialogForViewModel <T>(IResultDialogViewModel <T> vm)
 {
     if (vm is AddToInventoryViewModel)
     {
         return(new AddToInventoryModalDialog((AddToInventoryViewModel)vm));
     }
     else if (vm is AddGroceryItemTypeViewModel)
     {
         return(new AddGroceryItemTypeModalDialog((AddGroceryItemTypeViewModel)vm));
     }
     else
     {
         return(new LcarsModalDialog());
     }
 }