private void StartupAfterGettingResources(object sender, StartupEventArgs e) { string baseUrl = getBaseUri(e); MainPage mainPage = null; ViewerApplicationControl viewerControl = new ViewerApplicationControl() { BaseUri = new Uri(baseUrl, UriKind.Absolute) }; this.RootVisual = mainPage = new MainPage() { Content = viewerControl }; viewerControl.ViewInitialized += (o, args) => { viewerControl.View.ApplicationColorSet.SyncDesignHostBrushes = true; }; RTLHelper helper = Application.Current.Resources["RTLHelper"] as RTLHelper; Debug.Assert(helper != null); if (helper != null) { mainPage.FlowDirection = helper.FlowDirection; } WebClientFactory.Initialize(); ImageUrlResolver.RegisterImageUrlResolver(new UrlResolver(baseUrl)); }
private void loadUI() { MapApplication.SetApplication(BuilderApplication.Instance); AppCoreHelper.SetService(new ApplicationServices()); this.RootVisual = mainPage = new MainPage() { DataContext = BuilderApplication.Instance, }; ESRI.ArcGIS.Mapping.Core.Utility.SetRTL(mainPage); ImageUrlResolver.RegisterImageUrlResolver(new BuilderImageUrlResolver()); WebClientFactory.Initialize(); NotificationPanel.Instance.Initialize(); if (!NotificationPanel.Instance.OptedOutOfNotification) { EventHandler handler = null; handler = (o, e) => { if (NotificationPanel.Instance.OptedOutOfNotification) { NotificationPanel.Instance.NotificationsUpdated -= handler; return; } showExtensionLoadFailedMessageOnStartup(); }; NotificationPanel.Instance.NotificationsUpdated += handler; if (hasStartupExtensionLoadFailedEvent) { showExtensionLoadFailedMessageOnStartup(); } } }