<UserControl
    x:Class="OpenSEMI.ClientBase.MessageDialogView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cal="http://www.caliburn.org"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:micro="clr-namespace:Caliburn.Micro"
    Background="Transparent">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
            <RowDefinition Height="10" />
        </Grid.RowDefinitions>
        <Grid.Effect>
            <DropShadowEffect
                BlurRadius="6"
                Opacity="0.6"
                ShadowDepth="6" />
        </Grid.Effect>
        <Grid
            MinWidth="300"
            MinHeight="200"
            MaxWidth="650"
            MaxHeight="400"
            Margin="0,0,10,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition />
                <RowDefinition Height="10" />
            </Grid.RowDefinitions>

            <Border
                x:Name="DialogWindow"
                Grid.Row="1"
                MinWidth="300"
                MinHeight="200"
                MaxWidth="600"
                MaxHeight="400"
                Background="{DynamicResource Color_BG_Dialog}"
                BorderBrush="{DynamicResource Color_BD_Dialog}"
                BorderThickness="1,1,0,0">
                <Border BorderBrush="{DynamicResource Color_BG_Dialog_Shadow}" BorderThickness="0,0,1,1">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Rectangle
                            Grid.RowSpan="2"
                            Margin="5"
                            Fill="{DynamicResource Color_BG_Dialog_Inner}" />
                        <ScrollViewer
                            Margin="20,20,20,0"
                            CanContentScroll="True"
                            HorizontalScrollBarVisibility="Disabled"
                            VerticalScrollBarVisibility="Auto">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="40" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid VerticalAlignment="Top">
                                    <Grid
                                        x:Name="Warning"
                                        Width="40"
                                        Height="40">
                                        <Grid Width="30" Height="30">
                                            <Ellipse Fill="#FF8B5D00">
                                                <Ellipse.Effect>
                                                    <DropShadowEffect
                                                        BlurRadius="10"
                                                        ShadowDepth="0"
                                                        Color="White" />
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10" />
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0" Color="#FFEB9E00" />
                                                        <GradientStop Offset="1" Color="#FFFDFA00" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0.2" Color="White" />
                                                        <GradientStop Offset="1" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                FontFamily="Belwe Bd BT"
                                                FontSize="26.667"
                                                FontWeight="Bold"
                                                Foreground="#FF682600"
                                                Text="!"
                                                TextWrapping="Wrap">
                                                <TextBlock.Effect>
                                                    <DropShadowEffect ShadowDepth="0" Color="White" />
                                                </TextBlock.Effect>
                                            </TextBlock>
                                        </Grid>
                                        <Grid.Style>
                                            <Style>
                                                <Setter Property="Grid.Visibility" Value="Collapsed" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding DialogType}" Value="WARNING">
                                                        <Setter Property="Grid.Visibility" Value="Visible" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Style>
                                    </Grid>
                                    <Grid
                                        x:Name="Information"
                                        Width="40"
                                        Height="40">
                                        <Grid Width="30" Height="30">
                                            <Ellipse Fill="#FF00628B">
                                                <Ellipse.Effect>
                                                    <DropShadowEffect
                                                        BlurRadius="10"
                                                        ShadowDepth="0"
                                                        Color="White" />
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10" />
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0" Color="#FF007BDA" />
                                                        <GradientStop Offset="1" Color="#FF68C6D8" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0.2" Color="White" />
                                                        <GradientStop Offset="1" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock
                                                Margin="9.5,2.5,6.5,-2.5"
                                                FontFamily="Monotype Corsiva"
                                                FontSize="26.667"
                                                FontWeight="Bold"
                                                Foreground="#FF002368"
                                                Text="i"
                                                TextWrapping="Wrap">
                                                <TextBlock.Effect>
                                                    <DropShadowEffect ShadowDepth="0" Color="White" />
                                                </TextBlock.Effect>
                                            </TextBlock>
                                        </Grid>
                                        <Grid.Style>
                                            <Style>
                                                <Setter Property="Grid.Visibility" Value="Collapsed" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding DialogType}" Value="INFO">
                                                        <Setter Property="Grid.Visibility" Value="Visible" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Style>
                                    </Grid>
                                    <Grid
                                        x:Name="Error"
                                        Width="40"
                                        Height="40">
                                        <Grid Width="30" Height="30">
                                            <Ellipse Fill="#FFB60000">
                                                <Ellipse.Effect>
                                                    <DropShadowEffect
                                                        BlurRadius="10"
                                                        ShadowDepth="0"
                                                        Color="White" />
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10" />
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0" Color="#FFFF2F00" />
                                                        <GradientStop Offset="1" Color="#FFFF9D6F" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0.2" Color="White" />
                                                        <GradientStop Offset="1" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock
                                                Margin="0,2,0,0"
                                                HorizontalAlignment="Center"
                                                FontFamily="Arial Black"
                                                FontSize="24"
                                                FontWeight="Bold"
                                                Foreground="#FF740000"
                                                Text="×"
                                                TextWrapping="Wrap">
                                                <TextBlock.Effect>
                                                    <DropShadowEffect ShadowDepth="0" Color="White" />
                                                </TextBlock.Effect>
                                            </TextBlock>
                                        </Grid>
                                        <Grid.Style>
                                            <Style>
                                                <Setter Property="Grid.Visibility" Value="Collapsed" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding DialogType}" Value="ERROR">
                                                        <Setter Property="Grid.Visibility" Value="Visible" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Style>
                                    </Grid>
                                    <Grid
                                        x:Name="Confirm"
                                        Width="40"
                                        Height="40">
                                        <Grid Width="30" Height="30">
                                            <Ellipse Fill="#FF006A28">
                                                <Ellipse.Effect>
                                                    <DropShadowEffect
                                                        BlurRadius="10"
                                                        ShadowDepth="0"
                                                        Color="White" />
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10" />
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0" Color="#FF68EB00" />
                                                        <GradientStop Offset="1" Color="#FFE1FF82" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                        <GradientStop Offset="0.2" Color="White" />
                                                        <GradientStop Offset="1" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Path
                                                Margin="8,9.5,6,12.5"
                                                Data="M0,0 L4,0 4,3.8890872 16.010408,3.8890872 16.010408,7.8890872 0.010407538,7.8890872 0.010407538,3.9999998 0,3.9999998 z"
                                                Fill="#FF005601"
                                                RenderTransformOrigin="0.500325027316656,0.746485246105757"
                                                Stretch="Fill">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform />
                                                        <SkewTransform />
                                                        <RotateTransform Angle="-50" />
                                                        <TranslateTransform />
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                            </Path>
                                        </Grid>
                                        <Grid.Style>
                                            <Style>
                                                <Setter Property="Grid.Visibility" Value="Collapsed" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding DialogType}" Value="CONFIRM">
                                                        <Setter Property="Grid.Visibility" Value="Visible" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Style>
                                    </Grid>
                                </Grid>
                                <TextBlock
                                    Grid.Column="1"
                                    Margin="0,10,0,0"
                                    VerticalAlignment="Top"
                                    FontFamily="Arial"
                                    FontSize="14"
                                    Foreground="{DynamicResource Color_FG_Black}"
                                    Text="{Binding Text}"
                                    TextAlignment="Left"
                                    TextWrapping="Wrap" />
                            </Grid>
                        </ScrollViewer>
                        <ListBox
                            Grid.Row="1"
                            Margin="0,0,0,10"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Background="{x:Null}"
                            BorderThickness="0"
                            ItemsSource="{Binding Buttons}">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VirtualizingStackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Button
                                        Width="75"
                                        Height="30"
                                        Margin="5,0"
                                        Content="{Binding Name}"
                                        IsCancel="{Binding IsCancel}"
                                        IsDefault="{Binding IsDefault}">
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <micro:ActionMessage MethodName="OnButtonClick">
                                                    <micro:Parameter Value="$source" />
                                                </micro:ActionMessage>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Button>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </Border>
            </Border>
            <Path
                Grid.Row="2"
                Width="8"
                Margin="0,-2,40,0"
                HorizontalAlignment="Right"
                Data="M8,0 L8,4 4,0"
                Fill="{DynamicResource Color_BG_Dialog}"
                Stretch="Fill"
                Stroke="{DynamicResource Color_BG_Dialog_Shadow}" />
        </Grid>
    </Grid>
</UserControl>
