Beispiel #1
0
        protected void InitPerspex(Type appType)
        {
            if (_initialized)
            {
                return;
            }
            _initialized = true;

            var window     = new UIWindow(UIScreen.MainScreen.Bounds);
            var controller = new PerspexViewController(window);

            window.RootViewController = controller;
            window.MakeKeyAndVisible();

            Application.RegisterPlatformCallback(() =>
            {
                MouseDevice    = new MouseDevice();
                KeyboardDevice = new KeyboardDevice();
                SharedPlatform.Register(appType.Assembly);
                PerspexLocator.CurrentMutable
                .Bind <IClipboard>().ToTransient <Clipboard>()
                //.Bind<ISystemDialogImpl>().ToTransient<SystemDialogImpl>()
                .Bind <IStandardCursorFactory>().ToTransient <CursorFactory>()
                .Bind <IKeyboardDevice>().ToConstant(KeyboardDevice)
                .Bind <IMouseDevice>().ToConstant(MouseDevice)
                .Bind <IPlatformSettings>().ToSingleton <PlatformSettings>()
                .Bind <IPlatformThreadingInterface>().ToConstant(PlatformThreadingInterface.Instance)
                .Bind <IWindowImpl>().ToConstant(controller.PerspexView);
                SkiaPlatform.Initialize();
            });
        }
Beispiel #2
0
 public static void Initialize()
 {
     PerspexLocator.CurrentMutable
     .Bind <IWindowingPlatform>().ToConstant(s_instance)
     .Bind <IClipboard>().ToSingleton <ClipboardImpl>()
     .Bind <IStandardCursorFactory>().ToConstant(CursorFactory.Instance)
     .Bind <IKeyboardDevice>().ToConstant(GtkKeyboardDevice.Instance)
     .Bind <IMouseDevice>().ToConstant(GtkMouseDevice.Instance)
     .Bind <IPlatformSettings>().ToConstant(s_instance)
     .Bind <IPlatformThreadingInterface>().ToConstant(s_instance)
     .Bind <ISystemDialogImpl>().ToSingleton <SystemDialogImpl>();
     SharedPlatform.Register();
     _uiThread = Thread.CurrentThread;
 }
Beispiel #3
0
        private static void InitializeInternal()
        {
            PerspexLocator.CurrentMutable
            .Bind <IPopupImpl>().ToTransient <PopupImpl>()
            .Bind <IClipboard>().ToSingleton <ClipboardImpl>()
            .Bind <IStandardCursorFactory>().ToConstant(CursorFactory.Instance)
            .Bind <IKeyboardDevice>().ToConstant(WindowsKeyboardDevice.Instance)
            .Bind <IMouseDevice>().ToConstant(WindowsMouseDevice.Instance)
            .Bind <IPlatformSettings>().ToConstant(s_instance)
            .Bind <IPlatformThreadingInterface>().ToConstant(s_instance)
            .Bind <ISystemDialogImpl>().ToSingleton <SystemDialogImpl>();

            SharedPlatform.Register();
            _uiThread = Thread.CurrentThread;
        }
Beispiel #4
0
 public void Init(Type applicationType)
 {
     SharedPlatform.Register(applicationType.Assembly);
 }