public static InitializeWithDispatcher ( ) : void | ||
return | void |
protected override void Configure() { _phoneContainer = new PhoneContainer(); _analytics = new FlurryAnalytics(); RegisterConventions(); _phoneContainer.RegisterPhoneServices(RootFrame); RegisterServices(); RegisterViews(); RegisterStorageHandlers(); RegisterNavigationCoercion(); Execute.InitializeWithDispatcher(); LoadLanguagesAsync(); Telerik.Windows.Controls.LocalizationManager.GlobalStringLoader = new ResourceLoader(); Log.Init(new DebugLogger()); InitErrorHandler(); RootFrame.Navigating += RootFrameNavigating; RootFrame.Navigated += RootFrameNavigated; }
/// <summary> /// Called by the bootstrapper's constructor at runtime to start the framework. /// </summary> protected virtual void StartRuntime() { Execute.InitializeWithDispatcher(); EventAggregator.DefaultPublicationThreadMarshaller = Execute.OnUIThread; EventAggregator.HandlerResultProcessing = (target, result) => { var coroutine = result as IEnumerable <IResult>; if (coroutine != null) { var viewAware = target as IViewAware; var view = viewAware != null?viewAware.GetView() : null; var context = new ActionExecutionContext { Target = target, View = (DependencyObject)view }; Coroutine.BeginExecute(coroutine.GetEnumerator(), context); } }; AssemblySource.Instance.AddRange(SelectAssemblies()); if (useApplication) { Application = Application.Current; PrepareApplication(); } Configure(); IoC.GetInstance = GetInstance; IoC.GetAllInstances = GetAllInstances; IoC.BuildUp = BuildUp; }
/// <summary> /// Invoked when the application creates a window. /// </summary> /// <param name="args">Event data for the event.</param> protected override void OnWindowCreated(WindowCreatedEventArgs args) { base.OnWindowCreated(args); // Because dispatchers are tied to windows Execute will fail in // scenarios when the app has multiple windows open (though contract // activation, this keeps Excute up to date with the currently activated window args.Window.Activated += (s, e) => Execute.InitializeWithDispatcher(); }
/// <summary> /// Called by the bootstrapper's constructor at runtime to start the framework. /// </summary> protected virtual void StartRuntime() { Execute.InitializeWithDispatcher(); EventAggregator.DefaultPublicationThreadMarshaller = Execute.OnUIThread; AssemblySource.Instance.AddRange(SelectAssemblies()); PrepareApplication(); Configure(); IoC.GetInstance = GetInstance; IoC.GetAllInstances = GetAllInstances; IoC.BuildUp = BuildUp; }
/// <summary> /// Creates an instance of the bootstrapper. /// </summary> public Bootstrapper() { if (IsInDesignMode) { return; } Execute.InitializeWithDispatcher(); AssemblySource.Instance.AddRange(SelectAssemblies()); Application = Application.Current; PrepareApplication(); Configure(); IoC.GetInstance = GetInstance; IoC.GetAllInstances = GetAllInstances; IoC.BuildUp = BuildUp; }
/// <summary> /// Called by the bootstrapper's constructor at runtime to start the framework. /// </summary> protected virtual void StartRuntime() { Execute.InitializeWithDispatcher(); EventAggregator.DefaultPublicationThreadMarshaller = Execute.OnUIThread; EventAggregator.HandlerResultProcessing = (target, result) => { #if !SILVERLIGHT || SL5 || WP8 var task = result as System.Threading.Tasks.Task; if (task != null) { result = new IResult[] { task.AsResult() }; } #endif var coroutine = result as IEnumerable <IResult>; if (coroutine != null) { var viewAware = target as IViewAware; var view = viewAware != null?viewAware.GetView() : null; var context = new ActionExecutionContext { Target = target, View = (DependencyObject)view }; Coroutine.BeginExecute(coroutine.GetEnumerator(), context); } }; AssemblySource.Instance.AddRange(SelectAssemblies()); PrepareApplication(); Configure(); IoC.GetInstance = GetInstance; IoC.GetAllInstances = GetAllInstances; IoC.BuildUp = BuildUp; }