<UserControl x:Class="District_3_App.LogIn.ForgotPassword"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:WpfTest="clr-namespace:Log_In"
             >

    <UserControl.Resources>
        <Style x:Key="RoundedTextBoxStyle" TargetType="TextBox">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Border BorderBrush="#8492A6" BorderThickness="1" CornerRadius="5">
                            <TextBox Text="{TemplateBinding Text}" 
                                  BorderThickness="0" 
                                  Background="Transparent" 
                                  Padding="10,10"
                                  Foreground="#8190A5"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="passwordbox" TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource {x:Type PasswordBox}}">
            <Setter Property="Padding"  Value="10, 10" />
            <Setter Property="WpfTest:PasswordBoxMonitor.IsMonitoring"
  Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type PasswordBox}">
                        <Border Background="{TemplateBinding Background}" 
x:Name="Bd" BorderBrush="#8492A6"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5">
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>

                                <TextBlock x:Name="txtPrompt" Text="{TemplateBinding Tag}" 
                                   Background="Transparent" 
                                   Visibility="Collapsed"
                                   Padding="10,10"
                                   Foreground="#8190A5" />
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="WpfTest:PasswordBoxMonitor.PasswordLength" Value="0">
                                <Setter Property="Visibility" TargetName="txtPrompt" Value="Visible"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="placeHolder" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
            <Setter Property="Padding"  Value="10, 10"/>
            <Setter Property="Foreground"  Value="Black"/>
            <Setter Property="Background"  Value="Transparent"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                        <Border x:Name="border" BorderBrush="#8492A6" BorderThickness="1" CornerRadius="5" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                                <TextBlock Text="{TemplateBinding Tag}" 
                                    Background="Transparent" 
                                    Padding="10,10"
                                    Foreground="#8190A5" IsHitTestVisible="False">
                                    <TextBlock.Style>
                                        <Style TargetType="TextBlock">
                                            <Setter Property="Visibility" Value="Hidden"/>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource AncestorType=TextBox}}" 
                                                     Value="">
                                                    <Setter Property="Visibility" Value="Visible"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </TextBlock.Style>
                                </TextBlock>

                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="ResetPasswordGrid" Background="White" Width="1300" Height="901" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="40,-10,0,0">
        <Border BorderBrush="#5A6978" BorderThickness="1" Margin="389,22,389,407">
            <Grid Margin="65,50,36,50">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" Text="Reset Password" FontSize="33" FontWeight="DemiBold" HorizontalAlignment="Center" Margin="0,-4,0,24" Foreground="#47525E"/>
                <TextBlock Text="Enter the email address associated with your account and" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="16" Margin="0,51,0,26" Grid.RowSpan="3" Width="462" Foreground="#8190A5"/>
                <TextBlock Grid.Row="2" Text="enter your new password below" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="16" Margin="79,13,0,10" Foreground="#8190A5"/>
                <TextBox Grid.Row="3" x:Name="txtEmail" Tag="Email" Width="290" Margin="11,20,11,11" Style="{StaticResource placeHolder}" Height="46" FontSize="16" Foreground="#8190A5"/>
                <StackPanel Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Top" Margin="46,80,0,0" Grid.RowSpan="2">
                    <PasswordBox Tag="New password" x:Name="txtNewPassword" Width="290" Margin="18,22,10,0" Height="46" FontSize="16" Foreground="#8190A5" Style="{StaticResource passwordbox}" RenderTransformOrigin="0.471,0.635"/>
                    <TextBox x:Name="txtVisiblePassword" Text="{Binding ElementName=txtNewPassword, Path=Password, Mode=TwoWay}" Visibility="Collapsed" Width="290" Margin="18,22,10,0" Height="46" FontSize="16" Foreground="#8190A5" Style="{StaticResource RoundedTextBoxStyle}"/>
                    <ToggleButton x:Name="TogglePasswordVisibility" Width="40" Height="40" Margin="0,22,10,0" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" Click="TogglePasswordVisibility_Click">
                        <Image x:Name="PasswordVisibilityIcon" Width="30" Height="30" Source="\images\hidePasswordIcon.png" RenderTransformOrigin="1.786,0.428" />
                    </ToggleButton>
                </StackPanel>
                <Button Grid.Row="5" x:Name="ResetPasswordButton" Content="Reset Password" Background="#FF47525E" Foreground="White" Margin="0,24,0,37" Width="290" Height="46" HorizontalAlignment="Center" FontSize="16" BorderBrush="#FF47525E" Grid.RowSpan="2" Click="ResetPasswordButton_Click">
                    <Button.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="5"/>
                        </Style>
                    </Button.Resources>
                </Button>

                <TextBlock Grid.Row="6" HorizontalAlignment="Left" Margin="161,128,0,-49" RenderTransformOrigin="0.621,1.479">
                    <Hyperlink Click="BackToSignIn_Click">
                        <TextBlock Text="&lt;" VerticalAlignment="Center" FontSize="18" Foreground="#8190A5"/>
                    </Hyperlink>
                    <Run Text=" Back" FontSize="16" Foreground="#8190A5"/>
                </TextBlock>
            </Grid>
        </Border>
    </Grid>
</UserControl>
