<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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:cal="http://www.caliburn.org"
             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" ShadowDepth="6" Opacity="0.6"/>
        </Grid.Effect>
        <Grid MinWidth="300" MaxWidth="650" MinHeight="200" MaxHeight="400" Margin="0,0,10,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition />
                <RowDefinition Height="10"/>
            </Grid.RowDefinitions>

            <Border x:Name="DialogWindow" BorderThickness="1,1,0,0" BorderBrush="{DynamicResource Color_BD_Dialog}" MinWidth="300" MinHeight="200" MaxWidth="600" MaxHeight="400" Grid.Row="1" Background="{DynamicResource Color_BG_Dialog}" >
                <Border BorderBrush="{DynamicResource Color_BG_Dialog_Shadow}" BorderThickness="0,0,1,1">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Rectangle Margin="5" Grid.RowSpan="2" Fill="{DynamicResource Color_BG_Dialog_Inner}"/>
                        <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" CanContentScroll="True" Margin="20,20,20,0">
                            <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 Color="White" ShadowDepth="0" BlurRadius="10"/>
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10"/>
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FFEB9E00" Offset="0"/>
                                                        <GradientStop Color="#FFFDFA00" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="White" Offset="0.2"/>
                                                        <GradientStop Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock TextWrapping="Wrap" Text="!" FontWeight="Bold" FontFamily="Belwe Bd BT" FontSize="26.667" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF682600">
                                                <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 Color="White" ShadowDepth="0" BlurRadius="10"/>
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10"/>
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FF007BDA" Offset="0"/>
                                                        <GradientStop Color="#FF68C6D8" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="White" Offset="0.2"/>
                                                        <GradientStop Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock TextWrapping="Wrap" Text="i" FontSize="26.667" Foreground="#FF002368" FontFamily="Monotype Corsiva" Margin="9.5,2.5,6.5,-2.5" FontWeight="Bold">
                                                <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 Color="White" ShadowDepth="0" BlurRadius="10"/>
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10"/>
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FFFF2F00" Offset="0"/>
                                                        <GradientStop Color="#FFFF9D6F" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="White" Offset="0.2"/>
                                                        <GradientStop Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock TextWrapping="Wrap" Text="×" FontWeight="Bold" FontFamily="Arial Black" FontSize="24" HorizontalAlignment="Center" Foreground="#FF740000" Margin="0,2,0,0">
                                                <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 Color="White" ShadowDepth="0" BlurRadius="10"/>
                                                </Ellipse.Effect>
                                            </Ellipse>
                                            <Ellipse Margin="3,3,3,1.5">
                                                <Ellipse.Effect>
                                                    <BlurEffect Radius="10"/>
                                                </Ellipse.Effect>
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FF68EB00" Offset="0"/>
                                                        <GradientStop Color="#FFE1FF82" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Ellipse Margin="5,2.5,5,12">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="White" Offset="0.2"/>
                                                        <GradientStop Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Path 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" Margin="8,9.5,6,12.5" 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" TextAlignment="Left" Text="{Binding Text}" VerticalAlignment="Top" Margin="0,10,0,0" TextWrapping="Wrap" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource  Color_FG_Black}"></TextBlock>
                            </Grid>
                        </ScrollViewer>
                        <ListBox ItemsSource="{Binding Buttons}" BorderThickness="0" Grid.Row="1" Background="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,10">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VirtualizingStackPanel Orientation="Horizontal"></VirtualizingStackPanel>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Button Content="{Binding Name}" Width="75" Height="30" IsCancel="{Binding IsCancel}" IsDefault="{Binding IsDefault}" Margin="5,0">
                                        <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 Data="M8,0 L8,4 4,0" Fill="{DynamicResource Color_BG_Dialog}" HorizontalAlignment="Right" Margin="0,-2,40,0" Stretch="Fill" Width="8" Grid.Row="2" Stroke="{DynamicResource Color_BG_Dialog_Shadow}"/>
        </Grid>
    </Grid>
</UserControl>
