Interaction logic for ErrorView.xaml
Inheritance: System.Windows.Controls.UserControl
Exemplo n.º 1
0
        ProgressView StartInstallation(IInstallerFactory installerFactory)
        {
            var ctSource = new CancellationTokenSource();
            var p        = new ProgressView();

            installerFactory
            .Start(p.Progress, p.UpdateCommand, ctSource.Token)
            .ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    if (t.Exception?.InnerException is OperationCanceledException)
                    {
                        Exit();
                        return;
                    }

                    Dispatcher.Invoke(() =>
                    {
                        InnerContent = new ErrorView(_logPath, Exit);
                    });
                }
                else
                {
                    Exit();
                }
            });

            p.OnCancel += (o, eventArgs) => ctSource.Cancel();

            return(p);
        }
Exemplo n.º 2
0
        ProgressView StartInstallation(IInstallerFactory installerFactory)
        {            
            var ctSource = new CancellationTokenSource();
            var p = new ProgressView();
            installerFactory
                .Start(p.Progress, p.UpdateCommand, ctSource.Token)
                .ContinueWith(t =>
                {
                    if (t.IsFaulted)
                    {
                        if (t.Exception?.InnerException is OperationCanceledException)
                        {
                            Exit();
                            return;
                        }

                        Dispatcher.Invoke(() =>
                        {
                            InnerContent = new ErrorView(_logPath, Exit);
                        });
                    }
                    else
                    {
                        Exit();
                    }
                });
            
            p.OnCancel += (o, eventArgs) => ctSource.Cancel();

            return p;
        }
Exemplo n.º 3
0
 public MainWindowDesignSample()
 {
     InnerContent = new ErrorView("C:\\Foo", () => {});
 }