<Window 
    x:Class="HashCalculator.GUI.CopyableBox"
    x:Name="Self"
    x:ClassModifier="internal"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:HashCalculator.GUI"
    mc:Ignorable="d"
    Title="{Binding Title}" Height="350" Width="600"
    Closing="ClosingHandler"
    Style="{StaticResource CommonStyle}"
>
    <Window.DataContext>
        <local:CopyableBoxViewModel />
    </Window.DataContext>
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="60"/>
        </Grid.RowDefinitions>
        <Button 
            Content="复制所有内容" 
            Command="{Binding CopyCommand}"
            Grid.Row="1"
            Margin="10,0,0,10" 
            Width="120" 
            Height="30" 
            HorizontalAlignment="Left" 
            VerticalAlignment="Bottom"
        />
        <Button 
            Content="{Binding CloseButtonText}" 
            Command="{Binding CloseCommand}"
            CommandParameter="{Binding ElementName=Self}"
            Margin="0,0,10,10" 
            Grid.Row="1" 
            Width="100" 
            Height="30" 
            HorizontalAlignment="Right" 
            VerticalAlignment="Bottom" 
        />
        <TextBox 
            Grid.Row="0"
            Text="{Binding Text, Mode=OneWay}"
            IsReadOnly="True"
            TextWrapping="Wrap"
        />
    </Grid>
</Window>