static Registrations() { // override Splat's mode detector with our own. This allows us to by-pass the performance hit that // we would incur using the default Splat implementation ModeDetector.OverrideModeDetector(CustomModeDetector.Instance); // seems stupid, but this forces the RxApp static constructor to run // without this, our registrations below might be overwritten by RxUI when it eventually initializes RxApp.DefaultExceptionHandler = RxApp.DefaultExceptionHandler; }
public static IDisposable Set() { PlatformModeDetector.OverrideModeDetector(Instance); ModeDetector.OverrideModeDetector(Instance); return(Disposable.Create(() => { PlatformModeDetector.OverrideModeDetector(new DefaultPlatformModeDetector()); ModeDetector.OverrideModeDetector(new DefaultModeDetector()); })); }
public static void Register(bool isDebugMode) { if (isDebugMode) { Locator.CurrentMutable.RegisterConstant(new DebugLogger(), typeof(ILogger)); RxApp.DefaultExceptionHandler = new NavigationExceptionHandler(); } else { Locator.CurrentMutable.RegisterConstant(new AppCenterLogger(), typeof(ILogger)); ModeDetector.OverrideModeDetector(new SplatModeDetector()); } }
public static IDisposable Set() { ModeDetector.OverrideModeDetector(new ProductionMode()); return(Disposable.Create(() => ModeDetector.OverrideModeDetector(new PlatformModeDetector()))); }