<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:viewModel="clr-namespace:OzCommon.ViewModel" xmlns:utils="clr-namespace:OzCommon.Utils"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="OzCommon.View.LoginWindow"
        Title="Login" Height="260" Width="454" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Style="{DynamicResource WindowIconStyle}" ShowInTaskbar="True" Icon="..\Resources\Lock.ico" WindowStyle="None">
    <Window.Resources>
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0,2,40,2" />
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <DockPanel LastChildFill="true">
                            <Border Background="Red" DockPanel.Dock="right" Margin="5,0,0,0" Width="20" Height="20" CornerRadius="10"
                            ToolTip="{Binding AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=customAdorner}">
                                <TextBlock Text="!" VerticalAlignment="center" HorizontalAlignment="center" FontWeight="Bold" Foreground="white"/>
                            </Border>
                            <AdornedElementPlaceholder x:Name="customAdorner" VerticalAlignment="Center" >
                                <Border BorderBrush="red" BorderThickness="1" />
                            </AdornedElementPlaceholder>
                        </DockPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Window.DataContext>
        <viewModel:LoginViewModel/>
    </Window.DataContext>
    <Window.InputBindings>
        <KeyBinding Key="Enter" 
                    Command="{Binding Login}" />
    </Window.InputBindings>
	<DockPanel Background="#186218">
	<DockPanel Height="32" DockPanel.Dock="Top">
		<DockPanel.Background>
             <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                   <GradientStop Color="#FF235631" Offset="0"/>
                   <GradientStop Color="#FF1B3825" Offset="1"/>
                   </LinearGradientBrush>
             </DockPanel.Background>
			 <DockPanel LastChildFill="True" DockPanel.Dock="Left" Width="430" x:Name="LoginHeader" MouseDown="LoginHeader_MouseDown">
                <Image Source="..\Resources\lock.ico" Style="{DynamicResource AppImageStyle}" RenderOptions.BitmapScalingMode="HighQuality" Height="24" Margin="5,0,0,0" DockPanel.Dock="Left"/>
                 <Label Content="Login" FontSize="14" Foreground="Gray" DockPanel.Dock="Left" Width="420"/>
            </DockPanel>
			 <DockPanel>
			 	<TextBlock x:Name="LoginCloseButton" DockPanel.Dock="Right" Text="r" FontFamily="Webdings" Foreground="Gray" Margin="5,0,8,0"  HorizontalAlignment="Right" VerticalAlignment="Center" MouseLeftButtonUp="LoginCloseButtonMouseLeftButtonUp" MouseEnter="LoginCloseButton_OnMouseEnter" MouseLeave="LoginCloseButton_MouseLeave"/>
		 	 </DockPanel>
	</DockPanel>
        <Grid Margin="8">
            <Grid.Resources>
                <Style x:Key="zoldgomb" TargetType="{x:Type Button}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type Button}">
                                <Grid d:DesignWidth="146.096">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal">
                                                <Storyboard/>
                                            </VisualState>
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.095"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="rectangle">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.095"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="contentPresenter">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.209"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="contentPresenter">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.209"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="contentPresenter">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="contentPresenter">
                                                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ToolTipService.ToolTip)" Storyboard.TargetName="contentPresenter">
                                                        <DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Null}"/>
                                                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Click to login"/>
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.RowSpan)" Storyboard.TargetName="contentPresenter">
                                                        <EasingInt32KeyFrame KeyTime="0:0:0.2" Value="1"/>
                                                        <EasingInt32KeyFrame KeyTime="0:0:0.3" Value="1"/>
                                                    </Int32AnimationUsingKeyFrames>
                                                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="contentPresenter">
                                                        <EasingInt32KeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingInt32KeyFrame KeyTime="0:0:0.3" Value="1"/>
                                                    </Int32AnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FF052513"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.3" Value="White"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FF052513"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.3" Value="White"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.4" Value="White"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="contentPresenter">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.25"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-0.25"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.25"/>
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-0.25"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0" Value="#FF414141"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF414141"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0" Value="#FF545454"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF545454"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0" Value="#FF626262"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF626262"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0" Value="#FF787878"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF787878"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
                                                        <EasingColorKeyFrame KeyTime="0" Value="#FF494949"/>
                                                        <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF494949"/>
                                                    </ColorAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Unfocused"/>
                                            <VisualState x:Name="Focused">
                                                <Storyboard/>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="112.623" Margin="0" d:LayoutOverrides="Height" Panel.ZIndex="1" RenderTransformOrigin="0.568,0.657">
                                        <ContentPresenter.Resources>
                                            <Style TargetType="{x:Type TextBlock}">
                                                <Setter Property="Foreground" Value="White"/>
                                                <Setter Property="HorizontalAlignment" Value="Center"/>
                                                <Setter Property="FontSize" Value="16"/>
                                            </Style>
                                        </ContentPresenter.Resources>
                                        <ContentPresenter.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </ContentPresenter.RenderTransform>
                                    </ContentPresenter>
                                    <Rectangle x:Name="rectangle" Width="146.333" Height="35" Stroke="#FF052513" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" RenderTransformOrigin="0.5,0.5" >
                                        <Rectangle.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Rectangle.RenderTransform>
                                        <Rectangle.Effect>
                                            <DropShadowEffect Opacity="0.25" RenderingBias="Quality"/>
                                        </Rectangle.Effect>
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FF186218" Offset="0"/>
                                                <GradientStop Color="#FF01401D" Offset="1"/>
                                                <GradientStop Color="#FF0E5419" Offset="0.46"/>
                                                <GradientStop Color="#FF507E55" Offset="0.45"/>
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsFocused" Value="True"/>
                                    <Trigger Property="IsDefaulted" Value="True"/>
                                    <Trigger Property="IsMouseOver" Value="True"/>
                                    <Trigger Property="IsPressed" Value="True"/>
                                    <Trigger Property="IsEnabled" Value="False"/>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style TargetType="{x:Type Label}">
                    <Setter Property="FontSize" Value="15"/>
                    <Setter Property="Height" Value="30"/>
                </Style>
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="White" Offset="0"/>
                    <GradientStop Color="#FF6C9B6C" Offset="1"/>
                </LinearGradientBrush>
            </Grid.Background>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
			<DockPanel Margin="30,10,30,10">
                <TextBlock TextWrapping="Wrap" Margin="5,3,0,10" DockPanel.Dock="Top">Sign in with your User ID. For more information see the following <Hyperlink NavigateUri="http://www.ozekiphone.com" RequestNavigate="Hyperlink_RequestNavigate">link</Hyperlink>.</TextBlock>
                <DockPanel DockPanel.Dock="Top">
                        <Label Width="180"  Content="Server address"
				FontFamily="Arial" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,3,0,2"/>
					   <TextBox x:Name="ServerAddress" FontSize="15" VerticalAlignment="Center" VerticalContentAlignment="Center" ToolTip="Please, type your server address"
					   	Text="{Binding UserInfo.ServerAddress, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" BorderBrush="#FF07491B" SelectionBrush="#FF07491B" Margin="0" Height="30"/>
				</DockPanel>
				<DockPanel DockPanel.Dock="Top" Margin="0,6,0,0">
					<Label Width="180" HorizontalAlignment="Left" VerticalAlignment="Center"
						FontFamily="Arial" Content="Username" Margin="0,3,0,2"/>
					<TextBox x:Name="UserName" FontSize="15" Height="30" VerticalAlignment="Center" VerticalContentAlignment="Center" ToolTip="Please, type your username"
						Text="{Binding UserInfo.Username, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" BorderBrush="#FF07491B" SelectionBrush="#FF07491B" Margin="0"/>
				</DockPanel>
				<DockPanel DockPanel.Dock="Top" Margin="0,6,0,0">
					<Label Width="180" HorizontalAlignment="Left" VerticalAlignment="Center"
						FontFamily="Arial" Content="Password" Margin="0,3,0,2"/>
					<PasswordBox x:Name="Password" FontSize="15" Height="30" VerticalAlignment="Center" VerticalContentAlignment="Center" ToolTip="Please, type your password"
						utils:PasswordBoxAssistant.BindPassword="True" utils:PasswordBoxAssistant.BoundPassword="{Binding UserInfo.Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" BorderBrush="#FF07491B" SelectionBrush="#FF07491B" Margin="0"/>
					
				</DockPanel>
				<Grid Margin="0,10,0,0">
                    <Button Content="Login" Style="{StaticResource zoldgomb}" VerticalAlignment="Center" HorizontalAlignment="Right" ToolTip="Click to login" Command="{Binding Login}" Height="35" Width="146" d:LayoutOverrides="HorizontalAlignment" Margin="0"/>
         
					<CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Left" FontFamily="Arial" FontSize="15" Content="Remember me" IsChecked="{Binding RememberMe}" TabIndex="4" HorizontalAlignment="Left" />
         
				</Grid>
			</DockPanel>
         
        </Grid>
    </DockPanel>
</Window>
