/// <summary> /// Launch special application link /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HyperlinkNewProject_Click(object sender, System.Windows.RoutedEventArgs e) { StartupDlg dlg = new StartupDlg(); dlg.Owner = Application.Current.MainWindow; dlg.DataContext = BindingView.Instance; dlg.ShowDialog(); }
/// <summary> /// OnInitialized is used to statup with a new project or the dialog without freezing /// the main window that must show /// </summary> /// <param name="e"></param> protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); Tracer.Verbose("MainWindow:OnInitialized", "START"); try { if (WorkspaceService.Instance.Entity.StartupProject != null) { Tracer.Verbose("MainWindow:OnInitialized", "StartupProject"); OpenProject(WorkspaceService.Instance.Entity.StartupProject); WorkspaceService.Instance.Entity.StartupProject = null; } else if (WorkspaceService.Instance.Entity.ShowStartupDlg) { Tracer.Verbose("MainWindow:OnInitialized", "StartupDlg"); this.IsEnabled = false; Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.SystemIdle, new ThreadStart(delegate { StartupDlg dlg = new StartupDlg(); dlg.Owner = this; dlg.DataContext = BindingView.Instance; dlg.ShowDialog(); })); this.IsEnabled = true; } } catch (Exception err) { Tracer.Error("MainWindow.OnInitialized", err); } finally { Tracer.Verbose("MainWindow:OnInitialized", "END"); } }