<Window x:Class="OPSCallCenterCRMServer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ViewModel="clr-namespace:OPSCallCenterCRMServer.ViewModel" mc:Ignorable="d"
        Title="Call Center CRM Server" Height="400" Width="600"
        Icon="Styles/call_center_client.ico"
        MinHeight="350" MinWidth="525" ResizeMode="CanResizeWithGrip" AllowsTransparency="True" WindowStartupLocation="CenterScreen" WindowStyle="None" StateChanged="MainWindow_OnStateChanged">
    <Window.DataContext>
        <ViewModel:MainViewModel/>
    </Window.DataContext>
    <Grid Background="#186218">
        <DockPanel VerticalAlignment="Stretch"
                   Background="#1c4027"
                   LastChildFill="True">
            <Grid Margin="0"
                  DockPanel.Dock="Top"
                  x:Name="MainDockpanel">
                <DockPanel>
                    <Grid DockPanel.Dock="Top"
                          Height="32">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="0.5,1"
                                                 StartPoint="0.5,0">
                                <GradientStop Color="#FF235631"
                                              Offset="0" />
                                <GradientStop Color="#FF1B3825"
                                              Offset="1" />
                            </LinearGradientBrush>
                        </Grid.Background>
                        <DockPanel LastChildFill="True"
                                   x:Name="DragableArea"
                                   MouseDown="DragableGridMouseDown"
                                   MouseMove="DragableGrid_OnMouseMove"
                                   DockPanel.Dock="Top">
                            <DockPanel DockPanel.Dock="Left">
                                <Button x:Name="WindowIcon"
                                        RenderOptions.BitmapScalingMode="HighQuality"
                                        Content=""
                                        DockPanel.Dock="Left"
                                        Height="20"
                                        Margin="10,0,5,0"
                                        Style="{DynamicResource WindowIcon}"
                                        Click="WindowsIcon_Click">
                                    <Button.ContextMenu>
                                        <ContextMenu x:Name="WindowIconMenu">
                                            <MenuItem x:Name="RestoreWindowSize"
                                                      Header="Restore"
                                                      Click="RestoreWindowSize_Click">
                                                <MenuItem.Icon>
                                                    <TextBlock Text="2"
                                                               FontFamily="Webdings"
                                                               Foreground="Gray" />
                                                </MenuItem.Icon>
                                            </MenuItem>
                                            <MenuItem x:Name="MinimizedWindow"
                                                      Header="Minimize"
                                                      Click="MinimizeWindow_Click">
                                                <MenuItem.Icon>
                                                    <TextBlock Text="0"
                                                               FontFamily="Webdings"
                                                               Foreground="Gray" />
                                                </MenuItem.Icon>
                                            </MenuItem>
                                            <MenuItem x:Name="MaximizeWindow"
                                                      Header="Maximize"
                                                      Click="MaximizeWindow_Click">
                                                <MenuItem.Icon>
                                                    <TextBlock Text="1"
                                                               FontFamily="Webdings"
                                                               Foreground="Gray" />
                                                </MenuItem.Icon>
                                            </MenuItem>
                                            <Separator />
                                            <MenuItem Header="Close   Alt+F4"
                                                      x:Name="CloseWindow"
                                                      Click="CloseWindow_Click">
                                                <MenuItem.Icon>
                                                    <TextBlock Text="r"
                                                               FontFamily="Webdings"
                                                               Foreground="Gray"
                                                               FontWeight="Bold" />
                                                </MenuItem.Icon>
                                            </MenuItem>
                                        </ContextMenu>
                                    </Button.ContextMenu>
                                </Button>
                                <Image  Source="Styles\ozeki_logo.png"
                                        Height="16"
                                        RenderOptions.BitmapScalingMode="HighQuality" />
                                <Label Content="Call Center CRM Server"
                                       VerticalContentAlignment="Center"
                                       FontFamily="Arial"
                                       FontSize="14"
                                       FontWeight="Normal"
                                       Foreground="#bbc4bc"
                                       DockPanel.Dock="Left" />
                            </DockPanel>
                            <TextBlock FontFamily="Arial"
                                       FontSize="14"
                                       FontWeight="Normal"
                                       Foreground="#bbc4bc"
                                       VerticalAlignment="Center"
                                       Margin="0,8"
                                       Width="237" />
                            <TextBlock DockPanel.Dock="Left"
                                       VerticalAlignment="Stretch" />
                        </DockPanel>

                        <DockPanel HorizontalAlignment="Right"
                                   VerticalAlignment="Center"
                                   DockPanel.Dock="Right"
                                   Margin="0,0,5,0">
                            <TextBlock x:Name="MinimizeButton"
                                       Text="0"
                                       FontFamily="Webdings"
                                       Foreground="Gray"
                                       Margin="5,0,0,0"
                                       HorizontalAlignment="Right"
                                       VerticalAlignment="Top"
                                       MouseLeftButtonUp="MinimizeButtonMouseLeftButtonUp"
                                       MouseEnter="MinimizeButton_OnMouseEnter"
                                       MouseLeave="MinizeButton_MouseLeave" />
                            <TextBlock x:Name="MaximizeButton"
                                       Text="1"
                                       FontFamily="Webdings"
                                       Visibility="Collapsed"
                                       Foreground="Gray"
                                       Margin="5,0,0,0"
                                       HorizontalAlignment="Right"
                                       VerticalAlignment="Top"
                                       MouseLeftButtonUp="MaximizeButtonMouseLeftButtonUp"
                                       MouseEnter="MaximizeButton_OnMouseEnter"
                                       MouseLeave="MaximizeButton_MouseLeave" />
                            <TextBlock x:Name="ChangeViewButton"
                                       Text="2"
                                       FontFamily="Webdings"
                                       Foreground="Gray"
                                       Margin="5,0,0,0"
                                       VerticalAlignment="Top"
                                       HorizontalAlignment="Right"
                                       MouseLeftButtonUp="ChangeViewButtonMouseLeftButtonUp"
                                       MouseEnter="ChangeViewButton_OnMouseEnter"
                                       MouseLeave="ChangeViewButton_MouseLeave" />
                            <TextBlock x:Name="CloseButton"
                                       Text="r"
                                       FontFamily="Webdings"
                                       Foreground="Gray"
                                       Margin="5,0,8,0"
                                       HorizontalAlignment="Right"
                                       VerticalAlignment="Top"
                                       MouseLeftButtonUp="CloseButtonMouseLeftButtonUp"
                                       MouseEnter="CloseButton_OnMouseEnter"
                                       MouseLeave="CloseButton_MouseLeave" />
                        </DockPanel>
                    </Grid>
                </DockPanel>
            </Grid>
            <DockPanel DockPanel.Dock="Top">
                <Menu x:Name="UpperMenu"
                      DockPanel.Dock="Top">
                    <Menu.Background>
                        <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                            <GradientStop Color="#FF1A2F21"
                                          Offset="0" />
                            <GradientStop Color="#FF20442A"
                                          Offset="1" />
                        </LinearGradientBrush>
                    </Menu.Background>

                    <MenuItem Header="_File"
                              Foreground="White"
                              Style="{DynamicResource menutitles}"
                              Margin="10,0,5,0">
                        <MenuItem Header="_Exit"
                                  Click="Exit_OnClick" Style="{DynamicResource submenutitles}"/>
                        
                    </MenuItem>
                    <MenuItem Header="_Help"
                              Foreground="White"
                              Style="{StaticResource menutitles}">
                        <MenuItem Header="_Visit to our Home Page"
                                  Command="{Binding HomePage}"
                                  Style="{StaticResource submenutitles}" />
                        <MenuItem Header="_About"
                                  Command="{Binding About}"
                                  Style="{StaticResource submenutitles}" />
                    </MenuItem>
                </Menu>
            </DockPanel>
            <DockPanel DockPanel.Dock="Top"
                       Background="#FF17913F"
                       Height="47"
                       VerticalAlignment="Top"
                       LastChildFill="True">


                <DockPanel>
                    <DockPanel.Background>
                        <ImageBrush ImageSource="/Styles\broadcast_menu_bg.png">
                        </ImageBrush>
                    </DockPanel.Background>
                    <Label/>
                    
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Server Events"
                                   FontSize="18" 
                                   VerticalAlignment="Center"/>
                            <Button Content="Clear"
                                    Height="23"
                                    Width="55"
                                    Margin="10,0,0,0"
                                    HorizontalAlignment="Right"
                                    Command="{Binding ClearLog}"></Button>
                        </StackPanel>
                        
                    
                </DockPanel>
                
                </DockPanel>
            <Grid Margin="8,0,8,8" >
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                    <ListBox ItemsSource="{Binding Logs}"
                         Height="auto"
                             MinHeight="255"
                             Background="#dceadd" />
                    </ScrollViewer>
                <tb:TaskbarIcon x:Name="TaskBarIcon"
                                MenuActivation="RightClick"
                                IconSource="Resources/call_center_manager.ico">
                    <tb:TaskbarIcon.ContextMenu>
                        <ContextMenu x:Name="ContextMenu">
                            <MenuItem Header="About"
                                      Command="{Binding About}" />
                            <MenuItem Header="Close"
                                      Click="Exit_OnClick" />
                        </ContextMenu>
                    </tb:TaskbarIcon.ContextMenu>
                </tb:TaskbarIcon>
            </Grid>
            </DockPanel>
        
        
               
    </Grid>
</Window>
