public ModalWindow(WebAuthenticatorWebView webView, CGRect rect) : base(rect, GetStyle(webView), NSBackingStore.Buffered, false) { webview = new WeakReference(webView); webView.Frame = rect; ContentView = webView; IsVisible = false; Title = webView.Authenticator.Title; this.Delegate = this; }
static NSWindowStyle GetStyle(WebAuthenticatorWebView webView) { var baseStyle = NSWindowStyle.Titled | NSWindowStyle.Resizable; if (webView.Authenticator.AllowsCancel) { baseStyle = baseStyle | NSWindowStyle.Closable; } return(baseStyle); }
public static async void ShowWebivew(WebAuthenticatorWebView webview) { var app = NSApplication.SharedApplication; var rect = new CoreGraphics.CGRect(0, 0, 400, 600); window = new ModalWindow(webview, rect); while (shownInWindow == null) { shownInWindow = app.MainWindow; if (shownInWindow == null) { await Task.Delay(1000); } } webview.BeginLoadingInitialUrl(); app.RunModalForWindow(window); //app.BeginSheet (window, shownInWindow); }
public static async void ShowWebivew(WebAuthenticatorWebView webview) { var app = NSApplication.SharedApplication; var rect = new CoreGraphics.CGRect(0, 0, 400, 600); webview.Frame = rect; window = new NSWindow(rect, NSWindowStyle.Closable | NSWindowStyle.Titled, NSBackingStore.Buffered, false); window.ContentView = webview; window.IsVisible = false; window.Title = webview.Authenticator.Title; while (shownInWindow == null) { shownInWindow = app.MainWindow; if (shownInWindow == null) { await Task.Delay(1000); } } app.BeginSheet(window, shownInWindow); webview.BeginLoadingInitialUrl(); }
public static async void ShowWebivew(WebAuthenticatorWebView webview) { var app = NSApplication.SharedApplication; var rect = new CoreGraphics.CGRect (0, 0, 400, 600); webview.Frame = rect; window = new NSWindow (rect, NSWindowStyle.Closable | NSWindowStyle.Titled, NSBackingStore.Buffered, false); window.ContentView = webview; window.IsVisible = false; window.Title = webview.Authenticator.Title; while (shownInWindow == null) { shownInWindow = app.MainWindow; if (shownInWindow == null) await Task.Delay (1000); } app.BeginSheet (window, shownInWindow); webview.BeginLoadingInitialUrl (); }