Exemplo n.º 1
0
        internal Task <T> Show()
        {
            _dialogHost = _dialogHostLocator.GetPart().Start(_title, _content, _commands);
            var tcs = new TaskCompletionSource <T>();

            _dialogHost.Completed += (sender, args) =>
            {
                if (Cancelled)
                {
                    tcs.SetCanceled();
                }
                else
                {
                    tcs.SetResult(DialogResult);
                }
            };
            _windowManager.ShowDialog(_dialogHost);
            return(tcs.Task);
        }
Exemplo n.º 2
0
 public DialogClosingStrategy(DialogHostBase dialogHost)
 {
     _dialogHost = dialogHost;
 }