Example #1
0
        protected sealed override Task OnInitialize(RenderLoop <TReactor> viewModel)
        {
            var view = GetView <WpfPresenter>();

            viewModel.Reactor = ServiceLocator.Default.CreateInstance <TReactor>();
            view.Background   = Brushes.Black;
            view.Loaded      += (o, e) => view.Run();

            OnInitialize(view, viewModel.Reactor);

            return(Task.CompletedTask);
        }
Example #2
0
        protected sealed override Task OnShutdown(RenderLoop <TReactor> viewModel)
        {
            var view = GetView <WpfPresenter>();

            if (view != null)
            {
                if (viewModel.Reactor != null)
                {
                    OnTerminate(view, viewModel.Reactor);

                    viewModel.Reactor.Dispose();
                    viewModel.Reactor = null;
                }
            }

            return(Task.CompletedTask);
        }