@@ -78,6 +78,7 @@ public MainWindow()
7878 $ "Choose { CancelPrompts . ButtonLabel } and wait for the image operation to finish before closing.", InfoBarSeverity . Warning ) ;
7979 } ;
8080 WorkspaceBox . Text = @"C:\tiny11" ;
81+ SupportPurpose . Text = ProjectSupport . Purpose ;
8182 OutputBox . Text = Path . Combine ( WorkspaceBox . Text , $ "tiny11-{ DateTime . Now : yyyyMMdd-HHmmss} .iso") ;
8283 BuildStages . ItemsSource = board . Stages ;
8384 progressTimer . Tick += ( _ , _ ) => { FlushBuildProgress ( ) ; DrainDownload ( ) ; } ;
@@ -211,6 +212,7 @@ private void UpdateNavigation()
211212 Microsoft . UI . Xaml . Automation . AutomationProperties . SetName ( NextButton , ActionLabel . Text ) ;
212213 StepRail . IsEnabled = ! busy && ! completed ;
213214 RecoverButton . IsEnabled = ! busy ;
215+ SupportButton . IsEnabled = ! busy ;
214216 ResumeButton . IsEnabled = ! busy ;
215217 ThemeChoice . IsEnabled = ! busy && ! HighContrast ;
216218 // Advisory only: the checkpoint file's presence decides whether to offer Resume; the engine verifies it.
@@ -584,6 +586,50 @@ private async Task<bool> Confirm(string title, string content, string action)
584586 }
585587 }
586588
589+ private async void OnSupport ( object sender , RoutedEventArgs args )
590+ {
591+ if ( busy || modalOpen || Root . XamlRoot is null ) return ;
592+ modalOpen = true ;
593+ var previousFocus = CurrentFocus ( ) ;
594+ try
595+ {
596+ SupportDialog . XamlRoot = Root . XamlRoot ;
597+ SupportDialog . RequestedTheme = DialogTheme ( ) ;
598+ SupportError . IsOpen = false ;
599+ await SupportDialog . ShowAsync ( ) ;
600+ }
601+ catch ( Exception error )
602+ {
603+ ShowNotice ( "Support options could not be opened." , ErrorText . Reason ( error ) ,
604+ InfoBarSeverity . Error , NoticeAction . CopyDetails , error . ToString ( ) ) ;
605+ }
606+ finally
607+ {
608+ modalOpen = false ;
609+ RestoreFocus ( previousFocus ) ;
610+ }
611+ }
612+
613+ private async void OnSupportDestination ( object sender , RoutedEventArgs args )
614+ {
615+ try
616+ {
617+ if ( sender is not FrameworkElement { Tag : string tag } ||
618+ ! Enum . TryParse < SupportDestination > ( tag , out var destination ) )
619+ throw new InvalidDataException ( "This support link has no valid destination." ) ;
620+ var uri = ProjectSupport . Link ( destination ) ;
621+ if ( ! await Windows . System . Launcher . LaunchUriAsync ( uri ) )
622+ throw new IOException ( $ "Your browser could not open { uri } . No payment was made.") ;
623+ SupportError . IsOpen = false ;
624+ }
625+ catch ( Exception error )
626+ {
627+ SupportError . Title = "Could not open the support page" ;
628+ SupportError . Message = ErrorText . Reason ( error ) ;
629+ SupportError . IsOpen = true ;
630+ }
631+ }
632+
587633 private async Task < string ? > Pick ( Func < Task < string ? > > pick )
588634 {
589635 if ( modalOpen ) return null ;
0 commit comments