Blueprint loading works

This commit is contained in:
2021-01-30 22:46:48 +01:00
parent 295f63669d
commit 1ab244f7c5
21 changed files with 710 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace EveCalc.Shared.Views
{
/// <summary>
/// Interaction logic for BrowserView.xaml
/// </summary>
public partial class BrowserView : Window
{
public string AuthCode { get; private set; }
public BrowserView()
{
this.InitializeComponent();
//this.WbrBrowser.EnsureCoreWebView2Async().Wait();
}
public BrowserView(string url) : this()
{
this.WbrBrowser.Source = new Uri(url);
}
private void WbrBrowser_NavigationStarting(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationStartingEventArgs e)
{
this.TxtUrl.Text = e.Uri.ToString();
if (this.TxtUrl.Text.StartsWith("https://localhost/evecalc?code="))
{
// Habemus login
var split = this.TxtUrl.Text.Split(new[] { "code=", "&state=" }, StringSplitOptions.None);
this.AuthCode = split[1];
this.DialogResult = true;
this.Close();
}
}
}
}