Beispiel #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    WindowsFormsHost?.Dispose();
                    ForegroundWindow?.Close();
                }

                ViewContent      = null;
                ForegroundWindow = null;
                disposedValue    = true;
            }
        }
Beispiel #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (!IsDesignMode)
            {
                var windowsFormsHost = WindowsFormsHost;
                if (windowsFormsHost != null)
                {
                    ForegroundWindow = new ForegroundWindow(windowsFormsHost)
                    {
                        OverlayContent = ViewContent
                    };

                    _operation.InitializationMapControl(WindowsFormsHost);

                    DataContext = new MainWindowViewModel();
                }
            }
        }