Exemplo n.º 1
0
        public Application(App application)
        {
            _application = application;

            if (_application.ApplicationLifetime is Lifetimes.IControlledApplicationLifetime controller)
            {
                EventHandler <Lifetimes.ControlledApplicationLifetimeExitEventArgs> eh = default !;
Exemplo n.º 2
0
        public static void Initialize(Avalonia.Application app)
        {
            AvaloniaLocator.CurrentMutable
            .Bind <IClipboard>().ToTransient <ClipboardImpl>()
            .Bind <IStandardCursorFactory>().ToTransient <CursorFactory>()
            .Bind <IKeyboardDevice>().ToSingleton <AndroidKeyboardDevice>()
            .Bind <IPlatformSettings>().ToConstant(Instance)
            .Bind <IPlatformThreadingInterface>().ToConstant(new AndroidThreadingInterface())
            .Bind <ISystemDialogImpl>().ToTransient <SystemDialogImpl>()
            .Bind <IWindowingPlatform>().ToConstant(Instance)
            .Bind <IPlatformIconLoader>().ToSingleton <PlatformIconLoader>()
            .Bind <IRenderLoop>().ToConstant(new DefaultRenderLoop(60))
            .Bind <IAssetLoader>().ToConstant(new AssetLoader(app.GetType().Assembly));

            SkiaPlatform.Initialize();
            ((global::Android.App.Application)global::Android.App.Application.Context.ApplicationContext)
            .RegisterActivityLifecycleCallbacks(new ActivityTracker());
        }