using HandBrakeWPF.Model;\r
using HandBrakeWPF.Services.Interfaces;\r
using HandBrakeWPF.ViewModels.Interfaces;\r
+ using HandBrakeWPF.Views;\r
\r
using Ookii.Dialogs.Wpf;\r
\r
/// </summary>\r
public void OpenAboutApplication()\r
{\r
- this.WindowManager.ShowWindow(IoC.Get<IAboutViewModel>());\r
+ Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(AboutView));\r
+\r
+ if (window != null)\r
+ {\r
+ window.Activate();\r
+ }\r
+ else\r
+ {\r
+ this.WindowManager.ShowWindow(IoC.Get<IAboutViewModel>());\r
+ }\r
}\r
\r
/// <summary>\r
/// </summary>\r
public void OpenLogWindow()\r
{\r
- this.WindowManager.ShowWindow(IoC.Get<ILogViewModel>());\r
+ Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(LogView));\r
+\r
+ if (window != null)\r
+ {\r
+ window.Activate();\r
+ }\r
+ else\r
+ {\r
+ this.WindowManager.ShowWindow(IoC.Get<ILogViewModel>());\r
+ }\r
}\r
\r
/// <summary>\r
/// </summary>\r
public void OpenQueueWindow()\r
{\r
- this.WindowManager.ShowWindow(IoC.Get<IQueueViewModel>());\r
+ Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(QueueView));\r
+\r
+ if (window != null)\r
+ {\r
+ window.Activate();\r
+ }\r
+ else\r
+ {\r
+ this.WindowManager.ShowWindow(IoC.Get<IQueueViewModel>());\r
+ }\r
}\r
\r
/// <summary>\r
/// </summary>\r
public void OpenPreviewWindow()\r
{\r
- IPreviewViewModel viewModel = IoC.Get<IPreviewViewModel>();\r
- this.WindowManager.ShowWindow(viewModel);\r
- viewModel.Task = this.CurrentTask;\r
+ Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(PreviewView));\r
+\r
+ if (window != null)\r
+ {\r
+ window.Activate();\r
+ }\r
+ else\r
+ {\r
+ IPreviewViewModel viewModel = IoC.Get<IPreviewViewModel>();\r
+ this.WindowManager.ShowWindow(viewModel);\r
+ }\r
}\r
\r
/// <summary>\r