summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/ErrorView.xaml
blob: 54cb7a2e6f46d4a0f95f660148fb37674aec2291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<Window x:Class="HandBrakeWPF.Views.ErrorView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cal="http://www.caliburnproject.org"
        Title="{Binding Title}"
        Width="680"
        Height="380"
        MinWidth="680"
        MinHeight="380"
        Style="{StaticResource windowStyle}"
        FontSize="11"
        TextOptions.TextFormattingMode="Display"
        WindowStartupLocation="CenterOwner">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!--  Header  -->
        <StackPanel Grid.Row="0"
                    Margin="0,0,0,0"
                    Orientation="Horizontal">

            <StackPanel.Style>
                <Style TargetType="StackPanel">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding UseSystemColours}" Value="False">
                            <Setter Property="Background" Value="White" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </StackPanel.Style>

            <Image Width="64"
                   Height="64"
                   Margin="10,4,0,4"
                   Source="Images/ErrorX.png" />
            <Grid Margin="10,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0"
                           Margin="0,5,0,0"
                           FontWeight="Bold"
                           Text="{Binding ErrorMessage}" />
                <TextBlock Grid.Row="1"
                           Margin="0,5,0,0"
                           Text="{Binding Solution}" TextWrapping="Wrap" />

                <TextBlock Grid.Row="2"
                           Margin="0,0,0,2"
                           VerticalAlignment="Bottom"
                           FontWeight="Bold"
                           Text="Error Details:" />
            </Grid>
        </StackPanel>

        <!--  Details  -->
        <TextBox Grid.Row="1"
                 Margin="84,10,10,10"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Stretch"
                 IsReadOnly="True"
                 Text="{Binding Details}"
                 TextWrapping="Wrap"
                 VerticalScrollBarVisibility="Auto" />


        <!--  Controls  -->
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Grid.Style>
                <Style TargetType="Grid">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding UseSystemColours}" Value="False">
                            <Setter Property="Background" Value="LightGray" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Style>

            <Button Grid.Column="1"
                    Margin="5"
                    cal:Message.Attach="[Event Click] = [Action Copy]"
                    Padding="8,2">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Image Grid.Column="0"
                           Width="16"
                           Height="16"
                           Margin="0,0,5,0"
                           Source="Images/copy.png" />
                    <TextBlock Grid.Column="1" Text="Copy to Clipboard" />
                </Grid>
            </Button>

            <Button Grid.Column="2"
                    Margin="0,5,10,5"
                    cal:Message.Attach="[Event Click] = [Action Close]"
                    Content="Close"
                    Padding="8,2" />
        </Grid>
    </Grid>
</Window>