void UpdateFlowDirection() { UILanguage language = UILanguageService.GetLanguage(ResourceService.Language); Core.WinForms.RightToLeftConverter.IsRightToLeft = language.IsRightToLeft; this.FlowDirection = language.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; App.Current.Resources[GlobalStyles.FlowDirectionKey] = this.FlowDirection; }
static void InitializeWorkbench(WpfWorkbench workbench, IWorkbenchLayout layout) { SD.Services.AddService(typeof(IWorkbench), workbench); UILanguageService.ValidateLanguage(); TaskService.Initialize(); Project.CustomToolsService.Initialize(); workbench.Initialize(); workbench.SetMemento(SD.PropertyService.NestedProperties(workbenchMemento)); workbench.WorkbenchLayout = layout; // HACK: eagerly load output pad because pad services cannnot be instanciated from background threads SD.Services.AddService(typeof(IOutputPad), CompilerMessageView.Instance); var dlgMsgService = SD.MessageService as IDialogMessageService; if (dlgMsgService != null) { dlgMsgService.DialogSynchronizeInvoke = SD.MainThread.SynchronizingObject; dlgMsgService.DialogOwner = workbench.MainWin32Window; } var applicationStateInfoService = SD.GetService <ApplicationStateInfoService>(); if (applicationStateInfoService != null) { applicationStateInfoService.RegisterStateGetter(activeContentState, delegate { return(SD.Workbench.ActiveContent); }); } WorkbenchSingleton.OnWorkbenchCreated(); // initialize workbench-dependent services: NavigationService.InitializeService(); workbench.ActiveContentChanged += delegate { Debug.WriteLine("ActiveContentChanged to " + workbench.ActiveContent); LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent); }; workbench.ActiveViewContentChanged += delegate { Debug.WriteLine("ActiveViewContentChanged to " + workbench.ActiveViewContent); LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent); }; workbench.ActiveWorkbenchWindowChanged += delegate { Debug.WriteLine("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow); LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow); }; }