From d8fd0aa516b16dc094df0422a3adc525af005c29 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Thu, 12 Aug 2021 08:37:20 +0200 Subject: [PATCH] Fix more hyperlink issues --- ViewModels/MainViewModel.cs | 16 ++++++++++++++-- Views/About.xaml.cs | 5 ++++- Views/BootRestoreResourcesView.xaml.cs | 6 +++++- Views/FlashResourcesView.xaml.cs | 6 +++++- Views/LumiaDownloadView.xaml.cs | 5 ++++- Views/LumiaUnlockRootTargetSelectionView.xaml.cs | 5 ++++- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index 7218c3f..339ddcc 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -440,7 +440,13 @@ public ICommand OpenWebSiteCommand { get { - return _OpenWebSiteCommand ??= new DelegateCommand(() => Process.Start("www.wpinternals.net")); + return _OpenWebSiteCommand ??= new DelegateCommand(() => + { + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = "www.wpinternals.net"; + process.Start(); + }); } } @@ -449,7 +455,13 @@ public ICommand DonateCommand { get { - return _DonateCommand ??= new DelegateCommand(() => Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VY8N7BCBT9CS4")); + return _DonateCommand ??= new DelegateCommand(() => + { + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VY8N7BCBT9CS4"; + process.Start(); + }); } } diff --git a/Views/About.xaml.cs b/Views/About.xaml.cs index 6420756..70f9e93 100644 --- a/Views/About.xaml.cs +++ b/Views/About.xaml.cs @@ -39,7 +39,10 @@ private void HandleHyperlinkClick(object sender, RoutedEventArgs args) { if (args.Source is Hyperlink link) { - Process.Start(link.NavigateUri.ToString()); + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = link.NavigateUri.AbsoluteUri; + process.Start(); } } diff --git a/Views/BootRestoreResourcesView.xaml.cs b/Views/BootRestoreResourcesView.xaml.cs index b115da0..3cba0ff 100644 --- a/Views/BootRestoreResourcesView.xaml.cs +++ b/Views/BootRestoreResourcesView.xaml.cs @@ -18,6 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +using System.Diagnostics; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; @@ -54,7 +55,10 @@ private void HandleHyperlinkClick(object sender, RoutedEventArgs args) } else { - System.Diagnostics.Process.Start(link.NavigateUri.ToString()); + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = link.NavigateUri.AbsoluteUri; + process.Start(); } } } diff --git a/Views/FlashResourcesView.xaml.cs b/Views/FlashResourcesView.xaml.cs index df7bb90..936e646 100644 --- a/Views/FlashResourcesView.xaml.cs +++ b/Views/FlashResourcesView.xaml.cs @@ -18,6 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +using System.Diagnostics; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; @@ -48,7 +49,10 @@ private void HandleHyperlinkClick(object sender, RoutedEventArgs args) } else { - System.Diagnostics.Process.Start(link.NavigateUri.ToString()); + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = link.NavigateUri.AbsoluteUri; + process.Start(); } } } diff --git a/Views/LumiaDownloadView.xaml.cs b/Views/LumiaDownloadView.xaml.cs index e785178..7fe7356 100644 --- a/Views/LumiaDownloadView.xaml.cs +++ b/Views/LumiaDownloadView.xaml.cs @@ -53,7 +53,10 @@ private void HandleHyperlinkClick(object sender, RoutedEventArgs args) } else { - Process.Start(link.NavigateUri.AbsoluteUri); + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = link.NavigateUri.AbsoluteUri; + process.Start(); } } } diff --git a/Views/LumiaUnlockRootTargetSelectionView.xaml.cs b/Views/LumiaUnlockRootTargetSelectionView.xaml.cs index bce3299..d100941 100644 --- a/Views/LumiaUnlockRootTargetSelectionView.xaml.cs +++ b/Views/LumiaUnlockRootTargetSelectionView.xaml.cs @@ -57,7 +57,10 @@ private void HandleHyperlinkClick(object sender, RoutedEventArgs args) } else { - Process.Start(link.NavigateUri.ToString()); + Process process = new(); + process.StartInfo.UseShellExecute = true; + process.StartInfo.FileName = link.NavigateUri.AbsoluteUri; + process.Start(); } } }