private static void OnPaletteKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Tab && !e.Handled) { ApplicationWindow.HandleTabRequest(e); } }
private static void ThemePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ApplicationWindow applicationWindow = d as ApplicationWindow; if (applicationWindow != null && applicationWindow.ThemeChanged != null) { applicationWindow.ThemeChanged(applicationWindow, EventArgs.Empty); } }
private static void OnWindowKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Tab && !e.Handled) { ApplicationWindow.HandleTabRequest(e); } if (!e.Handled) { Window window = sender as Window; if (window != null) { Window owningWindow = ApplicationWindow.GetOwningWindow(window); if (owningWindow != null) { owningWindow.RaiseEvent(e); } } } }
public WindowService(IConfigurationObject configuration, ICommandBarService commandBarService, ICommandService commandService, IViewService viewService, IWorkspaceService workspaceService, IMessageDisplayService messageDisplayService, IFeedbackService feedbackService, FrameworkElement mainWindowRootElement, ResourceDictionary icons, ReadOnlyCollection <Theme> themes, bool suppressViewUI) { PerformanceUtility.StartPerformanceSequence(PerformanceEvent.WindowServiceConstructor); this.applicationWindow = new ApplicationWindow(configuration, feedbackService); this.applicationWindow.Closed += new EventHandler(this.ApplicationWindow_Closed); this.applicationWindow.Closing += new CancelEventHandler(this.ApplicationWindow_Closing); this.applicationWindow.ClosingCanceled += new EventHandler(this.ApplicationWindow_ClosingCanceled); this.applicationWindow.KeyDown += new KeyEventHandler(this.ApplicationWindow_KeyDown); this.applicationWindow.PreviewKeyDown += new KeyEventHandler(this.ApplicationWindow_PreviewKeyDown); this.applicationWindow.ThemeChanged += new EventHandler(this.ApplicationWindow_ThemeChanged); this.applicationWindow.StateChanged += new EventHandler(this.ApplicationWindow_StateChanged); this.applicationWindow.SourceInitialized += new EventHandler(this.ApplicationWindow_SourceInitialized); EventManager.RegisterClassHandler(typeof(GroupControl), UIElement.GotKeyboardFocusEvent, (Delegate) new KeyboardFocusChangedEventHandler(this.OnTabGroupGotKeyboardFocus)); EventManager.RegisterClassHandler(typeof(DocumentGroupControl), UIElement.KeyDownEvent, (Delegate) new KeyEventHandler(this.OnDocumentGroupKeyDownOrUp)); EventManager.RegisterClassHandler(typeof(DocumentGroupControl), UIElement.KeyUpEvent, (Delegate) new KeyEventHandler(this.OnDocumentGroupKeyDownOrUp)); this.commandService = commandService; this.viewService = viewService; this.workspaceService = workspaceService; if (icons != null) { this.AddResourceDictionary(icons); } if (themes.Count > 0) { foreach (ITheme theme in themes) { this.Themes.Add(theme); } if (configuration != null) { this.ActiveTheme = (string)configuration.GetProperty("ActiveTheme", (object)this.Themes[0].Name); int num = -1; for (int index = 0; index < this.Themes.Count; ++index) { if (this.Themes[index].Name == this.ActiveTheme) { num = index; break; } } if (feedbackService != null) { feedbackService.SetData(25, num + 1); } } } PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Create PaletteRegistry"); this.paletteRegistry = new PaletteRegistry(workspaceService); ViewElementFactory.Current = (ViewElementFactory) new ExpressionViewElementFactory(); if (!suppressViewUI) { this.dockingViewManager = new ExpressionViewManager(); ViewManager.Instance = (ViewManager)this.dockingViewManager; DockManager.Instance = (DockManager) new ExpressionDockManager(); if (viewService != null) { this.viewBridge = new ViewBridge(this.workspaceService, this.viewService, messageDisplayService); } } PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Create CommandBarService"); this.commandBarService = commandBarService; TextBoxHelper.RegisterType(typeof(TextBox)); PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Load Window Content"); this.mainBody = mainWindowRootElement; if (this.mainBody != null) { this.mainBody.DataContext = (object)this; FrameworkElement frameworkElement = this.commandBarService as FrameworkElement; if (frameworkElement != null) { frameworkElement.Name = "CommandBarService"; frameworkElement.VerticalAlignment = VerticalAlignment.Top; frameworkElement.SetValue(Grid.ColumnSpanProperty, (object)2); ((Panel)this.mainBody).Children.Insert(0, (UIElement)frameworkElement); } } PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Hookup Tree to Window Content"); this.applicationWindow.Content = (object)mainWindowRootElement; PerformanceUtility.EndPerformanceSequence(PerformanceEvent.WindowServiceConstructor); }