2022-05-20 03:23:16 +00:00
|
|
|
using System;
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
using System.Reactive.Concurrency;
|
2022-05-21 17:20:28 +00:00
|
|
|
using System.Reactive.Disposables;
|
|
|
|
using System.Reactive.Linq;
|
2022-05-20 03:23:16 +00:00
|
|
|
using System.Threading;
|
2023-11-19 21:07:46 +00:00
|
|
|
using System.Threading.Tasks;
|
2022-05-20 03:23:16 +00:00
|
|
|
using System.Windows;
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
using System.Windows.Controls;
|
2022-05-20 03:23:16 +00:00
|
|
|
using System.Windows.Input;
|
|
|
|
using MahApps.Metro.Controls;
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Web.WebView2.Wpf;
|
2022-05-21 17:20:28 +00:00
|
|
|
using ReactiveUI;
|
2022-05-20 03:23:16 +00:00
|
|
|
using Wabbajack.Common;
|
|
|
|
|
|
|
|
namespace Wabbajack;
|
|
|
|
|
|
|
|
public partial class BrowserWindow : MetroWindow
|
|
|
|
{
|
2022-05-21 17:20:28 +00:00
|
|
|
private readonly CompositeDisposable _disposable;
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
public WebView2 Browser { get; set; }
|
2022-05-21 17:20:28 +00:00
|
|
|
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
public BrowserWindow(IServiceProvider serviceProvider)
|
2022-05-20 03:23:16 +00:00
|
|
|
{
|
|
|
|
InitializeComponent();
|
2022-05-21 17:20:28 +00:00
|
|
|
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
|
2022-05-21 17:20:28 +00:00
|
|
|
_disposable = new CompositeDisposable();
|
New Wabbajack release (#2479)
* added more visible error messages to avoid user confusion
added hard drive free space detection, added red error message text, removed overwrite checkbox, added wiki button link
extended the error text for starting wabbajack in protected location
removed debug code
shortened error message to fit in text box
* restored warning removed in error, updated changelog, removed debug includes
* Update InstallerVM.cs
* Update InstallerVM.cs
* Update MainWindowViewModel.cs
* added json optional flag to only show version number over modlist image in installer view, if the modlist image already contains the title
removed debug code
change to pascal case and match existing code style
update changelog
* Fix manual downloads sometimes launching in browser
* Fix manual downloads from secure servers
* Remove duplicate user agent code
* Create configuration project and performance settings
* Bind new performance settings to UI
* Use performance settings to limit maximum memory per download
* Remove unused settings and related classes
* Updated CHANGELOG.md
* update CHANGELOG.md
* moved the existing files popup to an error message , heralding the return of the overwrite install checkbox
* added newline
* reverted erroneous edit
* gogID for fallout4 added
* update CHANGELOG.md
* Fix deadlock when loading new settings
* change folder/directory check logic
* update CHANGELOG.md
* revert unnecessary change
* update CHANGELOG.md
* Bump Wabbajack to .NET 7
* Bump ReactiveUI packages & deps
* Update GameFinder to 4.0.0
* Update CHANGELOG.md
* Update CHANGELOG.md
* Don't try to add cookies if array is empty
* Start download from scratch if .download_package can't be parsed
* Log when application is shutting down
* update CHANGELOG.md
* exclude the "SP Consent Message" on nexus from the cleared iframes
* Actually use the --outputPath compile option if the user provides one
It was just not being used, defaulting to the parent of installPath. it
still does, if the user does not specify a directory using --outputPath
* update Wabbajack.Compression.BSA dependencies
* improve log message to include storage space reference
* clearing temp folder when the app closes
* update logging message
* update CHANGELOG.md
* update CHANGELOG.md
* update logging for possible exceptions thrown when clearing temp folder
* fix cloudflare captcha
* update Final Fantasy VII: RI metadata
* Update CHANGELOG.md
* fix error
* Update GameRegistry.cs
* Updated GameFinder, Added EADesktop module
* updated version number in CHANGELOG.md
* updated logging code
* update CHANGELOG.md
* Fix Nexus login (#2476)
* Fix Nexus login handler after API keys web page changes
* Automatically press request button
* Automatically press request API key button
* Fix BG3 being named badlursgate3 in Game enum instead of baldursgate3
* Fix WebView2 taking up tons of memory, use single WebView window - still needs refactoring
* Remove commented WebView
* Add changelog, fix Wabbajack CLI bat pointing to the wrong directory
---------
Co-authored-by: JanuarySnow <bobfordiscord12@gmail.com>
Co-authored-by: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com>
Co-authored-by: UrbanCMC <UrbanCMC@web.de>
Co-authored-by: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com>
Co-authored-by: Marco Antonio Jaguaribe Costa <marco.antonio.costa@gmail.com>
2024-01-14 21:48:34 +00:00
|
|
|
_serviceProvider = serviceProvider;
|
|
|
|
Browser = _serviceProvider.GetRequiredService<WebView2>();
|
|
|
|
RxApp.MainThreadScheduler.Schedule(() =>
|
|
|
|
{
|
|
|
|
if(Browser.Parent != null)
|
|
|
|
{
|
|
|
|
((Panel)Browser.Parent).Children.Remove(Browser);
|
|
|
|
}
|
|
|
|
MainGrid.Children.Add(Browser);
|
|
|
|
Grid.SetRow(Browser, 3);
|
|
|
|
Grid.SetColumnSpan(Browser, 3);
|
|
|
|
});
|
2022-05-20 03:23:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e)
|
|
|
|
{
|
|
|
|
base.DragMove();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void BrowserWindow_OnActivated(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
var vm = ((BrowserWindowViewModel) DataContext);
|
|
|
|
vm.Browser = this;
|
2022-05-21 17:20:28 +00:00
|
|
|
|
|
|
|
vm.WhenAnyValue(vm => vm.HeaderText)
|
|
|
|
.BindToStrict(this, view => view.Header.Text)
|
|
|
|
.DisposeWith(_disposable);
|
|
|
|
|
|
|
|
vm.WhenAnyValue(vm => vm.Instructions)
|
|
|
|
.BindToStrict(this, view => view.Instructions.Text)
|
|
|
|
.DisposeWith(_disposable);
|
|
|
|
|
|
|
|
vm.WhenAnyValue(vm => vm.Address)
|
|
|
|
.BindToStrict(this, view => view.AddressBar.Text)
|
|
|
|
.DisposeWith(_disposable);
|
|
|
|
|
|
|
|
this.CopyButton.Command = ReactiveCommand.Create(() =>
|
|
|
|
{
|
|
|
|
Clipboard.SetText(vm.Address.ToString());
|
|
|
|
});
|
|
|
|
|
2022-05-21 17:24:15 +00:00
|
|
|
this.BackButton.Command = ReactiveCommand.Create(() =>
|
|
|
|
{
|
|
|
|
Browser.GoBack();
|
|
|
|
});
|
|
|
|
|
2022-05-20 03:23:16 +00:00
|
|
|
vm.RunWrapper(CancellationToken.None)
|
2022-09-25 19:10:49 +00:00
|
|
|
.ContinueWith(_ => Dispatcher.Invoke(() =>
|
|
|
|
{
|
|
|
|
Close();
|
|
|
|
}));
|
2022-05-20 03:23:16 +00:00
|
|
|
}
|
|
|
|
}
|