public ModalDialogViewModel(IModalContent content)
        {
            Content         = content ?? throw new ArgumentNullException(nameof(content));
            Content.Closed += OnContentClosed;

            _resultSource = new TaskCompletionSource <bool?>();
            CloseCommand  = new DelegateCommand(OnCloseExecuted);
        }
예제 #2
0
        public async Task <bool?> ShowOverlayAsync(IModalContent content)
        {
            var vm = new ModalDialogViewModel(content);

            View.DataContext = vm;

            Region.Add(View);

            var result = await vm.GetResultAsync();

            Region.Remove(View);

            return(result);
        }