public async Task <Application> Show(Type appType, ApplicationOptions opts = null) { LogSharp.Debug("UrhoSurface: Show."); await waitWhileSuperviewIsNullTaskSource.Task; UrhoPlatformInitializer.DefaultInit(); await Task.Yield(); paused = false; opts = opts ?? new ApplicationOptions(); LogSharp.Debug("UrhoSurface: Show. Wait semaphore."); await Semaphore.WaitAsync(); //await Stop(); if (Application.HasCurrent) { await Application.Current.Exit(); } await Task.Yield(); SDL_SetExternalViewPlaceholder(Handle, Window.Handle); Hidden = true; var app = Application.CreateInstance(appType, opts); Application = app; app.Run(); Semaphore.Release(); await Application.ToMainThreadAsync(); InvokeOnMainThread(() => Hidden = false); LogSharp.Debug("UrhoSurface: Finished."); return(app); }
public UrhoSurface(CGRect frame) : base(frame) { UrhoPlatformInitializer.DefaultInit(); BackgroundColor = UIColor.Black; initTaskSource = new TaskCompletionSource <bool>(); }
public UrhoSurface(CGRect frame) : base(frame) { UrhoPlatformInitializer.DefaultInit(); }
public override void WillMoveToWindow(UIWindow window) { UrhoPlatformInitializer.DefaultInit(); SDL_SetExternalViewPlaceholder(Handle, window?.Handle ?? IntPtr.Zero); base.WillMoveToWindow(window); }