2019-12-07 00:13:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-12-07 05:40:57 +00:00
|
|
|
|
using ReactiveUI;
|
2019-12-07 00:13:16 +00:00
|
|
|
|
using ReactiveUI.Fody.Helpers;
|
|
|
|
|
using Wabbajack.Lib;
|
2019-12-19 01:09:45 +00:00
|
|
|
|
using Wabbajack.Lib.LibCefHelpers;
|
2019-12-07 00:13:16 +00:00
|
|
|
|
using Xilium.CefGlue.WPF;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack
|
|
|
|
|
{
|
|
|
|
|
public class WebBrowserVM : ViewModel
|
|
|
|
|
{
|
|
|
|
|
[Reactive]
|
|
|
|
|
public string Instructions { get; set; }
|
|
|
|
|
|
2019-12-08 19:46:30 +00:00
|
|
|
|
public WpfCefBrowser Browser { get; } = new WpfCefBrowser();
|
2019-12-07 00:13:16 +00:00
|
|
|
|
|
2019-12-07 05:40:57 +00:00
|
|
|
|
[Reactive]
|
|
|
|
|
public IReactiveCommand BackCommand { get; set; }
|
2019-12-08 19:46:30 +00:00
|
|
|
|
|
2019-12-19 01:09:45 +00:00
|
|
|
|
private WebBrowserVM(string url = "http://www.wabbajack.org")
|
2019-12-07 00:13:16 +00:00
|
|
|
|
{
|
2019-12-07 05:40:57 +00:00
|
|
|
|
Browser.Address = url;
|
2019-12-07 00:13:16 +00:00
|
|
|
|
Instructions = "Wabbajack Web Browser";
|
|
|
|
|
}
|
2019-12-19 01:09:45 +00:00
|
|
|
|
|
|
|
|
|
public static async Task<WebBrowserVM> GetNew(string url = "http://www.wabbajack.org")
|
|
|
|
|
{
|
|
|
|
|
// Make sure libraries are extracted first
|
|
|
|
|
await Helpers.Initialize();
|
|
|
|
|
return new WebBrowserVM(url);
|
|
|
|
|
}
|
2019-12-07 00:13:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|