<ContentDialog
    x:Class="CharacterMap.Controls.UnhandledExceptionDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
    xmlns:core="using:CharacterMap.Core"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    x:Uid="DlgException"
    CornerRadius="{StaticResource PopupCornerRadius}"
    IsSecondaryButtonEnabled="False"
    PrimaryButtonStyle="{StaticResource DefaultThemeButtonStyle}"
    Style="{StaticResource DefaultThemeContentDialogStyle}"
    mc:Ignorable="d"
    d:PrimaryButtonText="{core:Localizer Key=DlgException/PrimaryButtonText}"
    d:Title="{core:Localizer Key=DlgException/Title}">

    <Grid RowSpacing="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Spacing="4">
            <TextBlock
                x:Uid="DlgExceptionMessage"
                TextWrapping="Wrap"
                d:Text="{core:Localizer Key=DlgExceptionMessage/Text}" />
            <HyperlinkButton Click="HyperlinkButton_Click">
                <TextBlock TextWrapping="Wrap">
                    <Run FontFamily="{ThemeResource SymbolThemeFontFamily}" Text="&#xE8A7;" />
                    <Run x:Uid="DlgExceptionCopyMessage" d:Text="{core:Localizer Key=DlgExceptionCopyMessage/Text}" />
                </TextBlock>
            </HyperlinkButton>
        </StackPanel>

        <!--<controls:Expander x:Uid="DlgExceptionExpander">-->
        <ScrollViewer
            Grid.Row="1"
            MaxHeight="500"
            HorizontalScrollBarVisibility="Auto"
            HorizontalScrollMode="Auto">
            <TextBlock
                x:Name="ExceptionBlock"
                Margin="8 8 8 24"
                IsTextSelectionEnabled="True">
                <d:TextBlock.Inlines>
                    <Run Text="StackTrace: '   at System.Environment.GetStackTrace(Exception e)" />
                    <LineBreak />
                    <Run Text="  at System.Environment.GetStackTrace(Exception e)" />
                    <LineBreak />
                    <Run Text="  at System.Environment.get_StackTrace()" />
                    <LineBreak />
                    <Run Text="  at Sample.Main()'" />
                </d:TextBlock.Inlines>
            </TextBlock>
        </ScrollViewer>
        <!--</controls:Expander>-->
    </Grid>
</ContentDialog>
