Integrazione 0.1.1: Febe per Windows si collega, VS Code, prove su Windows, storico e vista remota #4
@@ -1,6 +1,7 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Threading;
|
||||||
using Microsoft.Web.WebView2.Core;
|
using Microsoft.Web.WebView2.Core;
|
||||||
using Microsoft.Web.WebView2.Wpf;
|
using Microsoft.Web.WebView2.Wpf;
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ internal sealed class MainWindow : Window
|
|||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
if (uri.Scheme is "http" or "https")
|
if (uri.Scheme is "http" or "https")
|
||||||
{
|
{
|
||||||
_ = _openOutside(uri);
|
OpenOutsideLater(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +139,13 @@ internal sealed class MainWindow : Window
|
|||||||
}
|
}
|
||||||
else if (uri.Scheme is "http" or "https")
|
else if (uri.Scheme is "http" or "https")
|
||||||
{
|
{
|
||||||
_ = _openOutside(uri);
|
OpenOutsideLater(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens <paramref name="uri"/> in Alberto's browser once the handler of WebView2's event has returned: the shell
|
||||||
|
/// may run a message loop of its own, and WebView2 does not support re-entering its handlers (threading model).
|
||||||
|
/// </summary>
|
||||||
|
private void OpenOutsideLater(Uri uri) => Dispatcher.InvokeAsync(() => _openOutside(uri), DispatcherPriority.Background);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user