Exemplo n.º 1
0
 /// <summary>
 /// On deselection, informs the preview window that this object no longer sends preview data to be displayed.
 /// </summary>
 public void Deselected()
 {
     // Remove the preview window listener.
     processing.cameraSetup.onPreviewIndexChangeEvent.RemoveListener(OnPreviewIndexChange);
     // Inform the preview window that this object no longer sends preview data to be displayed.
     PreviewWindow.RemoveCaller(_renderCallerName);
     PreviewWindow.RemoveCaller(_evalCallerName);
 }
Exemplo n.º 2
0
 /// <summary>
 /// On deselection, informs the preview window that this object no longer sends preview data to be displayed.
 /// </summary>
 public void Deselected()
 {
     // Notify the camera setup.
     cameraSetup.Deselected();
     // Remove the preview window listener.
     cameraSetup.onPreviewIndexChangeEvent.RemoveListener(OnPreviewIndexChange);
     // Inform the preview window that this object no longer sends preview data to be displayed.
     PreviewWindow.RemoveCaller(_sourceCallerName);
 }
Exemplo n.º 3
0
        public override void Execute(object parameter)
        {
            var active = MainViewModel.ActiveDirectoryContainer.ActiveView;

            if (active.SelectedItem != null)
            {
                var pvWindow = new PreviewWindow(false);
                pvWindow.LoadFile(active.SelectedItem);
                pvWindow.ShowDialog();
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// On selection, adds listeners and callers for preview.
 /// </summary>
 public void Selected()
 {
     // Update the rendering queue.
     UpdateRenderingObjectsList();
     // Add a preview window listener.
     processing.cameraSetup.onPreviewIndexChangeEvent.AddListener(OnPreviewIndexChange);
     // Inform the preview window that this object will send preview data to be displayed.
     PreviewWindow.AddCaller(processing.cameraSetup, _renderCallerName);
     PreviewWindow.AddCaller(processing.cameraSetup, _evalCallerName);
     // Load the preview images.
     LoadRenderedViewAsPreview();
 }
Exemplo n.º 5
0
        public Editor(Pat.Project proj)
        {
            ProjectReset   += ResetActionIndex;
            AnimationReset += ResetPreviewMode;
            AnimationReset += ResetEditMode;

            Project = proj;

            AnimationFramesUI = new AnimationFrames(this);
            PreviewWindowUI   = new PreviewWindow(this);
            AnimationListUI   = new AnimationList(this);
        }
 /// <summary>
 /// Updates the preview camera's pose and parameters.
 /// </summary>
 public void UpdateCameraModel()
 {
     // Render the image and display it in the preview window.
     if (_previewCameraManager != null && _previewCameraManager.previewCamera != null)
     {
         // Set the preview camera to the current model parameters.
         _previewCameraManager.UpdateCameraModel(cameraModel);
         // Render the preview and display it.
         _previewCameraManager.RenderPreviewToTarget(ref _previewCameraManager.targetTexture, false);
         PreviewWindow.DisplayImage(_previewCallerName, _previewCameraManager.targetTexture, 0);
     }
 }
 /// <summary>
 /// On selection, initialize certain properties.
 /// </summary>
 public void Selected()
 {
     // Notify the camera setup.
     cameraSetup.Selected();
     // Add a preview window listener.
     cameraSetup.onPreviewIndexChangeEvent.AddListener(OnPreviewIndexChange);
     // Inform the preview window that this object will send preview data to be displayed.
     PreviewWindow.AddCaller(cameraSetup, _colorCallerName);
     PreviewWindow.AddCaller(cameraSetup, _depthCallerName);
     // Create a preview camera.
     CreatePreviewCameraFromPrefab();
 }
 /// <summary>
 /// On deselection, reset certain properties.
 /// </summary>
 public void Deselected()
 {
     // Notify the camera setup.
     cameraSetup.Deselected();
     // Destroy any objects created for preview.
     DestroyPreviewObjects();
     // Remove the preview window listener.
     cameraSetup.onPreviewIndexChangeEvent.RemoveListener(OnPreviewIndexChange);
     // Inform the preview window that this object no longer sends preview data to be displayed.
     PreviewWindow.RemoveCaller(_colorCallerName);
     PreviewWindow.RemoveCaller(_depthCallerName);
 }
Exemplo n.º 9
0
        /// <summary>
        /// Opens the Preview Window, with the clicked image in the middle
        /// </summary>
        private void ImageDoubleClicked(object sender, MouseButtonEventArgs e)
        {
            ImageDetails curr = Images.Where(x => x.Id == _currentImage).FirstOrDefault();

            if (_currentImage == Images.Count - 1)
            {
                curr = Images.Where(x => x.Id == _currentImage - 1).FirstOrDefault();
            }

            PreviewWindow previewWindow = new PreviewWindow(curr, Images);

            previewWindow.ShowDialog(); // show dialog disables the main window
        }
Exemplo n.º 10
0
        private async void startLiveViewBtn_Click(object sender, EventArgs e)
        {
            if (!isPreviewRunning_)
            {
                if (previewWindow_ == null)
                {
                    previewWindow_              = new PreviewWindow();
                    previewWindow_.FormClosing += new FormClosingEventHandler(
                        // Perform click will cause calling startLiveViewBtn() method, which stop preview and clean resources
                        (object s, FormClosingEventArgs args) => startLiveViewBtn.PerformClick()
                        );
                }

                liveViewService_.NvrPreviewSettings = new NvrPreviewSettings {
                    PreviewHandleMode = (PreviewHandleType)comboBox5.SelectedIndex,
                    LinkMode          = (PreviewLinkModeType)comboBox2.SelectedIndex,
                    StreamType        = (uint)numericUpDown1.Value,
                    DisplayBufNum     = (uint)numericUpDown2.Value,
                    IsBlocked         = checkBox2.Checked,
                    IsPassbackRecord  = checkBox1.Checked,
                    PlayerBufSize     = parseBufferSize(textBox5.Text),
                    PreviewMode       = (PreviewModeType)comboBox4.SelectedIndex,
                    PreviewQuality    = (PreviewQualityType)comboBox3.SelectedIndex
                };

                try {
                    liveViewService_.StartLiveView(previewWindow_.GetLiveViewHandle());
                } catch (Exception) {
                    return;
                }

                startLiveViewBtn.Text     = "Stop Live View";
                isPreviewRunning_         = true;
                userInfoGB.Enabled        = !isPreviewRunning_;
                previewSettingsGB.Enabled = !isPreviewRunning_;

                previewWindow_.Show(this);
            }
            else
            {
                await stopLiveViewAsync();

                isPreviewRunning_         = false;
                startLiveViewBtn.Text     = "Start Live View";
                userInfoGB.Enabled        = !isPreviewRunning_;
                previewSettingsGB.Enabled = !isPreviewRunning_;
                previewWindow_?.ResetLiveView();
                previewWindow_?.Dispose();
                previewWindow_ = null;
            }
        }
Exemplo n.º 11
0
        public void Close()
        {
            if (_fileImagePreviewWindow != null)
            {
                if (_fileImagePreviewWindow.IsLoaded)
                {
                    _fileImagePreviewWindow.Close();
                }

                _fileImagePreviewWindow = null;

                IsShown = false;
            }
        }
 /// <inheritdoc/>
 public override void Selected()
 {
     base.Selected();
     // If needed, initialize the preview camera.
     if (_previewCameraManager.previewCamera == null)
     {
         Transform previewCameraTransform = new GameObject("PreviewCamera").transform;
         GeneralToolkit.CreateRenderTexture(ref _previewCameraManager.targetTexture, Vector2Int.one, 0, RenderTextureFormat.ARGB32, false, FilterMode.Point, TextureWrapMode.Clamp);
         _previewCameraManager.CreatePreviewCamera(gameObject, previewCameraTransform, cameraModel);
     }
     // Notify the preview window that this object will send images for preview.
     PreviewWindow.AddCaller(this, _previewCallerName);
     // Update the camera model and display the rendered preview.
     UpdateCameraModel();
 }
Exemplo n.º 13
0
    internal static void OnLoad(PreviewWindow window)
    {
        if (SpriteData is null)
        {
            return;
        }

        PreviewBox = window.ImagePreviewBox;
        ProcessSprite();
        PreviewBox.Image = PreviewBitmap;
        if (PreviewBitmap is not null)
        {
            PreviewBox.Size = PreviewBitmap.Size;
        }
    }
Exemplo n.º 14
0
        private bool SetPreview()
        {
            #region SetPreview
            switch (this._selectedPrevMode)
            {
            case PrevMode.directDraw:
                RSRect rect = new RSRect();
                RS_SDK.GetClientRect(PreviewWindow.Handle, ref rect);

                m_result = RS_SDK.RS_SetViewWindow(this.deviceHandle, PreviewWindow.Handle, rect, false);
                if (m_result != RS_SDK.RS_SUCCESS)
                {
                    RS_SDK.RS_GetErrString(m_result, ref m_errorMsg);
                    MsgPanel.Text = m_errorMsg;
                    return(false);
                }

                m_prevStopped = false;

                //ClearAllOverlays.Enabled = true;
                //DrawOverlay.Enabled = true;
                PreviewWindow.Invalidate();
                PreviewWindow.Show();
                break;

            //case PrevMode.callbackDraw:
            //    m_result = RS_SDK.RS_RegisterPreviewCallback(deviceHandle, previewCallback);
            //    if (m_result != RS_SDK.RS_SUCCESS)
            //    {
            //        RS_SDK.RS_GetErrString(m_result, ref m_errorMsg);
            //        MsgPanel.Text = m_errorMsg;
            //    }
            //    break;
            //case PrevMode.advCallbackDraw:
            //    m_result = RS_SDK.RS_RegisterAdvPreviewCallback(deviceHandle, advPreviewCallback);
            //    if (m_result != RS_SDK.RS_SUCCESS)
            //    {
            //        RS_SDK.RS_GetErrString(m_result, ref m_errorMsg);
            //        MsgPanel.Text = m_errorMsg;
            //    }
            //    break;
            default:
                break;
            }
            return(true);

            #endregion
        }
Exemplo n.º 15
0
        /// <summary>
        /// Invoked when a preview command line switch (\p) is specified.
        /// </summary>
        /// <param name="previewWindow">Facilitates previewing the screen saver.</param>
        protected override void OnShowPreview(PreviewWindow previewWindow)
        {
            formScreenSaver.IsPreview = true;
#if DEBUG
            PreviewForm   formPreview = new PreviewForm();
            PreviewWindow window      = new PreviewWindow(formPreview.PreviewAreaHandle);
            window.Child = formScreenSaver.Handle;
            formScreenSaver.Show();
            Application.Run(formPreview);
#else
            Rectangle rect;
            NativeMethods.GetClientRect(previewWindow.Handle, out rect);
            previewWindow.Child = formScreenSaver.Handle;
            Application.Run(formScreenSaver);
#endif
        }
Exemplo n.º 16
0
        private static void Preview(EnvDTE.DTE dte, string file, int line)
        {
            //Window window = dte.Windows.Item("{9DDABE98-1D02-11D3-89A1-00C04F688DDE}");
            //window.Activate();
            //dte.MainWindow.SetKind(vsWindowType.vsWindowTypePreview);

            Window prev = new PreviewWindow();

            file = $"\"{file}\"";
            Console.WriteLine("Opening file: " + file + " on line: " + line);
            prev.Visible     = true;
            prev.WindowState = vsWindowState.vsWindowStateNormal;
            prev.Activate();
            //dte.ExecuteCommand("File.OpenFile", file);
            //dte.ExecuteCommand("Edit.GoTo", line.ToString());
        }
Exemplo n.º 17
0
        private void PreviewChanges()
        {
            var selectedTms        = _tmsCollection.Where(t => t.IsSelected).ToList();
            var selectedRulesCount = RulesCollection.Count(r => r.IsSelected);

            if (selectedTms.Count > 0 && selectedRulesCount > 0)
            {
                var serverTms = selectedTms.Where(s => s.IsServerTm).ToList();
                if (serverTms.Any())
                {
                    var uri = new Uri(_translationMemoryViewModel.Credentials.Url);
                    var translationProvider = new TranslationProviderServer(uri, false,
                                                                            _translationMemoryViewModel.Credentials.UserName,
                                                                            _translationMemoryViewModel.Credentials.Password);
                    //get all tus for selected translation memories
                    foreach (var serverTm in serverTms)
                    {
                        var tus = Tm.ServerBasedTmGetTranslationUnits(translationProvider, serverTm.Path,
                                                                      SourceSearchResults, GetSelectedRules());
                        if (!_anonymizeTranslationMemories.Exists(n => n.TmPath.Equals(tus.TmPath)))
                        {
                            _anonymizeTranslationMemories.Add(tus);
                        }
                    }
                }

                //file based tms
                foreach (var tm in selectedTms.Where(s => !s.IsServerTm))
                {
                    var tus = Tm.FileBaseTmGetTranslationUnits(tm.Path, SourceSearchResults, GetSelectedRules());
                    if (!_anonymizeTranslationMemories.Exists(n => n.TmPath.Equals(tus.TmPath)))
                    {
                        _anonymizeTranslationMemories.Add(tus);
                    }
                }
                var previewWindow    = new PreviewWindow();
                var previewViewModel = new PreviewWindowViewModel(SourceSearchResults, _anonymizeTranslationMemories,
                                                                  _tmsCollection, _translationMemoryViewModel);
                previewWindow.DataContext = previewViewModel;
                previewWindow.Show();
            }
            else
            {
                MessageBox.Show(@"Please select at least one translation memory and a rule to preview the changes",
                                "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        public BaseMatrixWindow CreateWindow()
        {
            PreviewWindow window = ScriptableObject.CreateInstance <PreviewWindow>();

            window.plugins = new IPlugin[] {
                new StatsPlugin(),
                new ViewPlugin(),
                new PixelPlugin(),
                new SlicePlugin(),
                new ExportPlugin()
            };
            window.preview  = this;
            window.colorize = true;
            window.relief   = true;
            window.name     = "Map Preview";

            return(window);
        }
Exemplo n.º 19
0
        private void ShowPreview()
        {
            PreviewWindow preview = new PreviewWindow();

            preview.Owner = this;


            preview.PathPreviewBefore.Width  = Int32.Parse(ReferenceWidth);
            preview.PathPreviewBefore.Height = Int32.Parse(ReferenceHeight);
            preview.PathPreviewBefore.Data   = Geometry.Parse(InputData);

            preview.PathPreviewAfter.Width  = Int32.Parse(TargetWidth);
            preview.PathPreviewAfter.Height = Int32.Parse(TargetHeight);
            preview.PathPreviewAfter.Data   = Geometry.Parse(OutputData);

            preview.SizeToContent = SizeToContent.WidthAndHeight;
            preview.Show();
        }
Exemplo n.º 20
0
    public static void Show(PreviewWindow thisWnd, Window wnd, MoeItem moeitem, ImageSource imgSource)
    {
        if (thisWnd == null)
        {
            thisWnd         = new PreviewWindow();
            thisWnd.Closed += delegate { thisWnd = null; };
            thisWnd.Owner   = wnd;
            thisWnd.Width   = wnd.Width * 0.85d;
            thisWnd.Height  = wnd.Height * 0.85d;
            thisWnd.Show();
        }
        else
        {
            thisWnd.Activate();
        }

        thisWnd.Init(moeitem, imgSource);
    }
Exemplo n.º 21
0
        /// <summary>
        /// Invoked when a preview command line switch (\p) is specified.
        /// </summary>
        /// <param name="previewWindow">Facilitates previewing the screen saver.</param>
        protected override void OnShowPreview(PreviewWindow previewWindow)
        {
            //var windowScreenSaver = new TScreenSaver();
            //previewWindow.Child = new WindowInteropHelper(windowScreenSaver).Handle;
            //// The drawing of this window is, by default, per screen,
            //// and needs to be aware of previewing.
            //windowScreenSaver.IsPreview = true;
            //Application.Current.Run(windowScreenSaver);

            var       windowScreenSaver = new TScreenSaver();
            Rectangle rect;

            NativeMethods.GetClientRect(previewWindow.Handle, out rect);
            previewWindow.Child = GetWindowHandle(windowScreenSaver);
            // The drawing of this window is, by default, per screen,
            // and needs to be aware of previewing.
            windowScreenSaver.IsPreview = true;
            Application.Current.Run(windowScreenSaver);
        }
Exemplo n.º 22
0
        /// <summary>
        /// Loads the selected source image as preview.
        /// </summary>
        public void LoadSourceImageAsPreview()
        {
            if (!Application.isPlaying || _previewSourceImagesLoader == null || _previewSourceImagesLoader.colorData == null ||
                cameraSetup.previewIndex == _lastLoadedPreviewIndex || cameraSetup.cameraModels == null || cameraSetup.cameraModels.Length < 1)
            {
                return;
            }
            _lastLoadedPreviewIndex = cameraSetup.previewIndex;
            if (previewSourceTexture != null)
            {
                DestroyImmediate(previewSourceTexture);
            }
            Vector2Int previewResolution = PreviewWindow.GetPreviewResolution(cameraSetup.cameraModels[_lastLoadedPreviewIndex].pixelResolution);

            GeneralToolkit.CreateRenderTexture(ref previewSourceTexture, previewResolution, 0, RenderTextureFormat.ARGB32, false, FilterMode.Point);
            Graphics.Blit(_previewSourceImagesLoader.colorData, previewSourceTexture, _lastLoadedPreviewIndex, 0);
            int previewMaxIndex = cameraSetup.cameraModels.Length - 1;

            PreviewWindow.DisplayImage(_sourceCallerName, previewSourceTexture, previewMaxIndex);
        }
Exemplo n.º 23
0
        private void LoadUI()
        {
            preview = new PreviewWindow(new Rectangle((Constants.SCREEN_WIDTH - PREVIEW_SPL_TOTAL_WIDTH) / 2,
                                                      (Constants.SCREEN_HEIGHT - PREVIEW_SPL_HEIGHT) / 2,
                                                      PREVIEW_WIDTH, PREVIEW_SPL_HEIGHT),
                                        Color.White);
            spl = new ScenarioPaginatedList(new Rectangle(preview.Area.X + preview.Area.Width,
                                                          preview.Area.Y,
                                                          SPL_WIDTH,
                                                          PREVIEW_SPL_HEIGHT),
                                            Color.DimGray, loader);

            PaginatedListItem.ContainerArea = spl.Area;
            spl.ScenarioSelected           += Spl_ScenarioSelected;
            preview.LoadRequested          += Preview_LoadRequested;

            SpriteFont buttonFont = GameRoot.ContentMgr.Load <SpriteFont>("Fonts/DefaultFont");
            ButtonPack buttonPack = new ButtonPack()
            {
                TexDefault  = GameRoot.ContentMgr.Load <Texture2D>("Controls/Buttons/BackButton"),
                TexHovered  = GameRoot.ContentMgr.Load <Texture2D>("Controls/Buttons/BackButtonHovered"),
                TexSelected = GameRoot.ContentMgr.Load <Texture2D>("Controls/Buttons/BackButtonSelected")
            };

            // Load "Back to menu" button
            int returnButtonMargin = 10;

            returnButton = new Button(isOriginAtCenter: false, buttonPack)
            {
                Text       = BACK_STRING,
                Dimensions = BACK_BUTTON_SIZE,
                Position   = new Vector2(Constants.SCREEN_WIDTH - BACK_BUTTON_SIZE.X - returnButtonMargin, returnButtonMargin)
            };

            returnButton.Click += ReturnButton_Click;

            components = new List <Control>
            {
                returnButton
            };
        }
Exemplo n.º 24
0
 public static void ShowWindow()
 {
     killWindow = false;
     if (window == null)
     {
         pos = new Vector2(0, 0);
         if (!dim.HasValue)
         {
             dim = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height);
         }
         window          = ScriptableObject.CreateInstance <PreviewWindow>();
         window.maxSize  = new Vector2(6000, 4000);
         window.position = new Rect(pos, dim.Value);
         window.ShowPopup();
     }
     else
     {
         killWindow = true;
         window.Close();
     }
 }
Exemplo n.º 25
0
 private void InitiatePreview()
 {
     if (PreviewIsOpen)
     {
         reloadPreview(null);
         return;
     }
     try
     {
         pwindow = new PreviewWindow();
         pwindow.ReloadRequested += new ReloadRequestedHandler(reloadPreview);
         pwindow.Closed          += new EventHandler(optimizator);
         LMD_Document lmdDoc = new LMD_Document(MathBox.getDocument(mbox.Document));
         pwindow.loadHTMLToPreview(lmdDoc.toHTML(LMD_Document.RenderingMode.LOCAL));
         pwindow.Show();
         PreviewIsOpen = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemplo n.º 26
0
        public PreviewMovingHandler(PreviewWindow parent, Control ctrl)
        {
            _Parent  = parent;
            _Control = ctrl;

            _PreviewX = ctrl.Width / 2;
            _PreviewY = ctrl.Height / 2;
            parent.Render.Transform.X = _PreviewX;
            parent.Render.Transform.Y = _PreviewY;

            MovablePreview              = new MouseMovable(ctrl, MouseButtons.Middle, _PreviewMovingX, _PreviewMovingY);
            MovablePreview.OnMovedDiff += delegate(int x, int y)
            {
                _PreviewMovingX = x;
                _PreviewMovingY = y;

                parent.Render.Transform.X = _PreviewX + _PreviewMovingX;
                parent.Render.Transform.Y = _PreviewY + _PreviewMovingY;

                OnSceneMoved();
            };
            MovablePreview.OnMoveFinished += delegate()
            {
                _PreviewX      += _PreviewMovingX;
                _PreviewY      += _PreviewMovingY;
                _PreviewMovingX = 0;
                _PreviewMovingY = 0;

                parent.Render.Transform.X = _PreviewX;
                parent.Render.Transform.Y = _PreviewY;

                OnSceneMoved();
            };

            //mouse wheel zoom in/out
            ctrl.FindForm().MouseWheel += _Control_MouseWheel;
            ctrl.MouseWheel += _Control_MouseWheel;
        }
Exemplo n.º 27
0
 /// <summary>
 /// On selection, reads source information and displays preview images.
 /// </summary>
 public void Selected()
 {
     // Notify the camera setup.
     cameraSetup.Selected();
     // Read the source data if necessary.
     if (cameraSetup.cameraModels == null)
     {
         cameraSetup.FindCameraModels();
     }
     // Check whether data has already been processed or bundled.
     dataHandler.CheckStatusOfDataProcessingAndBundling(out isDataReadyForBundling, out isDataBundled, out processedDataInfo);
     // Add a preview window listener.
     cameraSetup.onPreviewIndexChangeEvent.AddListener(OnPreviewIndexChange);
     // Inform the preview window that this object will send preview data to be displayed.
     PreviewWindow.AddCaller(cameraSetup, _sourceCallerName);
     // Load the preview images.
     LoadSourceImageAsPreview();
     // If it exists, inform the rendering component that it has been selected.
     if (renderingCaller != null)
     {
         renderingCaller.Selected();
     }
 }
 /*
  * 获取屏幕下的PageTemplate
  */
 private PageTemplate getScreen(int screenCfgId)
 {
     foreach (Window win in App.appWindowList)
     {
         string typename = win.GetType().Name;
         if (typename == "PreviewWindow")
         {
             PreviewWindow curr = (PreviewWindow)win;
             if (curr.screenCfgId == screenCfgId)
             {
                 return(curr.pageTemplate);
             }
         }
         else if (typename == "MainWindow")
         {
             MainWindow curr = (MainWindow)win;
             if (curr.screenCfgId == screenCfgId)
             {
                 return(curr.pageTemplate);
             }
         }
     }
     return(this.pageTemplate1);
 }
Exemplo n.º 29
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            //FileInfo file = new FileInfo(@"E:\Users\douglas\Documents\GitHub\WordToHtmlConverterTool\WordToHtmlConverter\Example.docx");
            FileInfo file = new FileInfo(FileToConvertTextBox.Text);

            if (file.Exists)
            {
                DirectoryInfo outputDir = new DirectoryInfo(Environment.CurrentDirectory + @"/outDir");
                if (!outputDir.Exists)
                {
                    Directory.CreateDirectory(outputDir.FullName);
                }

                var htmlFile = Converter.ToHtml(file.FullName, outputDir.FullName);

                var uri = new Uri(htmlFile.FullName);

                PreviewWindow.Navigate(uri);
            }
            else
            {
                MessageBox.Show("That file does not exist");
            }
        }
Exemplo n.º 30
0
        public void Show(ICollectionView fractalCollection)
        {
            if (_viewModel == null || !Object.ReferenceEquals(_viewModel.FractalCollection, fractalCollection))
            {
                _viewModel = new PreviewWindowViewModel(fractalCollection);
            }

            if (_window == null || !_window.IsLoaded)
            {
                _viewModel.Plot  = null;
                _viewModel.Title = String.Empty;
                _window          = new PreviewWindow {
                    DataContext = _viewModel
                };
                _window.Show();
            }
            else
            {
                _window.DataContext = _viewModel;
                _window.Activate();
            }

            _viewModel.RenderFractal();
        }