|
2 | 2 | x:Class="Natsurainko.FluentLauncher.Views.Dialogs.ExceptionDialog" |
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:controls="using:CommunityToolkit.WinUI.Controls" |
5 | 6 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | | - xmlns:local="using:Natsurainko.FluentLauncher.Views.Dialogs" |
7 | 7 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
8 | | - xmlns:vm="using:Natsurainko.FluentLauncher.ViewModels.Dialogs" |
9 | | - x:Name="Dialog" |
10 | | - x:Uid="Dialogs_ExceptionDialog" |
11 | | - Title="The program has encountered an error" |
12 | | - d:DataContext="{d:DesignInstance Type=vm:ExceptionDialogViewModel}" |
13 | | - DefaultButton="Primary" |
14 | | - PrimaryButtonCommand="{x:Bind VM.CopyAndLaunchGitHubCommand}" |
15 | | - PrimaryButtonText="Copy and go to GitHub" |
16 | | - SecondaryButtonText="Close" |
17 | 8 | Style="{ThemeResource DefaultContentDialogStyle}" |
| 9 | + Unloaded="Dialog_Unloaded" |
18 | 10 | mc:Ignorable="d"> |
19 | 11 |
|
| 12 | + <ContentDialog.Resources> |
| 13 | + <Thickness x:Key="ContentDialogPadding">0</Thickness> |
| 14 | + </ContentDialog.Resources> |
| 15 | + <ContentDialog.Title> |
| 16 | + <StackPanel Margin="24,24,24,0"> |
| 17 | + <TextBlock x:Uid="Dialogs_ExceptionDialog_Title" Text="The program has encountered an error" /> |
| 18 | + </StackPanel> |
| 19 | + </ContentDialog.Title> |
| 20 | + |
20 | 21 | <Grid> |
| 22 | + <Grid.Resources> |
| 23 | + <ResourceDictionary> |
| 24 | + <ResourceDictionary.ThemeDictionaries> |
| 25 | + <ResourceDictionary x:Key="Light"> |
| 26 | + <StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="ContentDialogDimmingThemeBrush" /> |
| 27 | + </ResourceDictionary> |
| 28 | + <ResourceDictionary x:Key="Dark"> |
| 29 | + <StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="ContentDialogSeparatorBorderBrush" /> |
| 30 | + </ResourceDictionary> |
| 31 | + </ResourceDictionary.ThemeDictionaries> |
| 32 | + </ResourceDictionary> |
| 33 | + </Grid.Resources> |
21 | 34 | <Grid.RowDefinitions> |
| 35 | + <RowDefinition Height="1*" /> |
22 | 36 | <RowDefinition Height="Auto" /> |
23 | | - <RowDefinition /> |
24 | 37 | </Grid.RowDefinitions> |
25 | | - <StackPanel Grid.Row="0"> |
26 | | - <TextBlock Text="Please report this issue on GitHub." /> |
27 | | - <TextBlock Text="Providing the following information might help us fix the issue:" /> |
28 | | - </StackPanel> |
| 38 | + <Grid |
| 39 | + Height="Auto" |
| 40 | + Padding="24,0,24,20" |
| 41 | + Background="Transparent"> |
| 42 | + <Grid> |
| 43 | + <Grid.RowDefinitions> |
| 44 | + <RowDefinition Height="Auto" /> |
| 45 | + <RowDefinition Height="Auto" /> |
| 46 | + <RowDefinition Height="*" /> |
| 47 | + </Grid.RowDefinitions> |
| 48 | + <StackPanel Grid.Row="0"> |
| 49 | + <TextBlock x:Uid="Dialogs_ExceptionDialog_Description_1" Text="Please report this issue on GitHub." /> |
| 50 | + <TextBlock x:Uid="Dialogs_ExceptionDialog_Description_2" Text="Providing the following information might help us fix the issue:" /> |
| 51 | + </StackPanel> |
| 52 | + |
| 53 | + <ScrollViewer |
| 54 | + Grid.Row="1" |
| 55 | + Padding="0,16" |
| 56 | + HorizontalScrollBarVisibility="Auto" |
| 57 | + VerticalScrollMode="Disabled"> |
| 58 | + <controls:Segmented x:Name="Segmented" SelectionChanged="Segmented_SelectionChanged" /> |
| 59 | + </ScrollViewer> |
29 | 60 |
|
30 | | - <ScrollViewer |
| 61 | + <ScrollViewer |
| 62 | + Grid.Row="2" |
| 63 | + Background="{ThemeResource ControlAltFillColorSecondaryBrush}" |
| 64 | + BorderBrush="{ThemeResource ControlStrokeColorDefaultBrush}" |
| 65 | + BorderThickness="1" |
| 66 | + CornerRadius="4" |
| 67 | + HorizontalScrollBarVisibility="Auto"> |
| 68 | + <TextBlock |
| 69 | + x:Name="TextBlock" |
| 70 | + Margin="8" |
| 71 | + IsTextSelectionEnabled="True" /> |
| 72 | + </ScrollViewer> |
| 73 | + </Grid> |
| 74 | + |
| 75 | + </Grid> |
| 76 | + <Rectangle |
31 | 77 | Grid.Row="1" |
32 | | - Margin="0,4,0,0" |
33 | | - Padding="0,0,10,10" |
34 | | - BorderBrush="Black" |
35 | | - BorderThickness="1" |
36 | | - CornerRadius="5" |
37 | | - HorizontalScrollBarVisibility="Auto"> |
38 | | - <Grid Margin="10,5,0,0"> |
39 | | - <TextBlock IsTextSelectionEnabled="True" Text="{x:Bind VM.ErrorMessage}" /> |
| 78 | + HorizontalAlignment="Stretch" |
| 79 | + VerticalAlignment="Stretch" |
| 80 | + Fill="{ThemeResource ContentDialogSmokeFill}" /> |
| 81 | + <Border |
| 82 | + Grid.Row="1" |
| 83 | + Padding="24" |
| 84 | + HorizontalAlignment="Stretch" |
| 85 | + VerticalAlignment="Bottom" |
| 86 | + Background="{ThemeResource ContentDialogBackground}" |
| 87 | + BorderBrush="{ThemeResource ContentDialogBorderBrush}" |
| 88 | + BorderThickness="0,1,0,0"> |
| 89 | + <Grid x:Name="CommandSpace" XYFocusKeyboardNavigation="Enabled"> |
| 90 | + <Grid.ColumnDefinitions> |
| 91 | + <ColumnDefinition Width="*" /> |
| 92 | + <ColumnDefinition Width="{ThemeResource ContentDialogButtonSpacing}" /> |
| 93 | + <ColumnDefinition Width="*" /> |
| 94 | + </Grid.ColumnDefinitions> |
| 95 | + <Button |
| 96 | + Grid.Column="0" |
| 97 | + HorizontalAlignment="Stretch" |
| 98 | + Click="CopyButton_Click" |
| 99 | + ElementSoundMode="FocusOnly" |
| 100 | + IsTabStop="False" |
| 101 | + Style="{ThemeResource AccentButtonStyle}"> |
| 102 | + <TextBlock x:Uid="Dialogs_ExceptionDialog_B1" Text="Copy and go to GitHub" /> |
| 103 | + </Button> |
| 104 | + <Button |
| 105 | + Grid.Column="2" |
| 106 | + HorizontalAlignment="Stretch" |
| 107 | + Click="CloseButton_Click" |
| 108 | + ElementSoundMode="FocusOnly" |
| 109 | + IsTabStop="False"> |
| 110 | + <TextBlock x:Uid="Dialogs_ExceptionDialog_B2" Text="Close" /> |
| 111 | + </Button> |
40 | 112 | </Grid> |
41 | | - </ScrollViewer> |
| 113 | + </Border> |
42 | 114 | </Grid> |
| 115 | + |
43 | 116 | </ContentDialog> |
0 commit comments