Windows Vista Login Screen made all in XAML

Hello,

Here you have the windows vista login screen made all in XAML. To download the complete Project click here.

If you have question please ask and I will answer to you.

Vista Login Screen

001-vista-login-screen.jpg

The graphical element where the image will be placed it’s just a Border that has inside some PATHS those were made in Microsoft Expression Design and exported to XAML.

The TextBox where you insert the user name it’s a normal text with a custom style which has 2 BORDER elements and inisde has the CONTENTPRESENTER:

<Border x:Name="OuterBorder" BorderBrush="#5AFFFFFF" BorderThickness="1,1,1,1? CornerRadius="4,4,4,4?>
<Border x:Name="InnerBorder" Background="#FFFFFFFF" BorderBrush="#33000000? BorderThickness="1,1,1,1? CornerRadius="3,3,3,3?>
<ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost"/>
</Border>
</Border>

The passworBox is the same only that has a Label with “Password” int the Content. Also i have put an trigger “IsFocused” which hides the label.

<ControlTemplate TargetType="{x:Type PasswordBox}">
<Border x:Name="OuterBorder" BorderBrush="#5AFFFFFF" BorderThickness="1,1,1,1? CornerRadius="4,4,4,4?>
<Border x:Name="InnerBorder" Background="#FFFFFFFF" BorderBrush="#33000000? BorderThickness="1,1,1,1? CornerRadius="3,3,3,3?>
<Grid>
<Label x:Name="lblPwd" Content="Password" FontSize="11? VerticalAlignment="Center" Margin="2,0,0,0? FontFamily="Verdana" Foreground="#828385? Padding="0?/>
<ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost"/>
</Grid>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Visibility" TargetName="lblPwd" Value="Hidden"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

Sample code

16 Responses

  1. laptop Says:

    a good read.

  2. sher Amir Says:

    Really splendid and intelligent code, I have ever found on net. Its working perfect for me. Keep it up

    Thanks

  3. samzon Says:

    once you enter text into the passwordbox field and set focus on another control the label becomes visible again so ‘Password’ displays with in the textbox again.

    Can this be fixed? And how would you achieve this?

  4. admin Says:

    Set a trigger

  5. ok Says:

    good site hpeaiq

  6. Bruno Says:

    This is cool, but where’s the button?

  7. David Garneau Says:

    Vista Login Screen

    the link to download de sample projet doesnt work :-( look like a good sample

    David

  8. admin Says:

    It works just fine.

  9. JaneRadriges Says:

    Hi, very nice post. I have been wonder’n bout this issue,so thanks for posting

  10. Behnam Says:

    Could you please specify that where can I put my Image. I have tried many positions (after layer_1, layer_2…) simultaneously changing the opacity of other layers. However, the result is not good and it seems very naive.

  11. Dragos Niamtu Says:

    You can insert the image before this line:
    <Canvas x:Name="Layer_2" Width="150" Height="150" Canvas.Left="0" Canvas.Top="0">

    Something like this:
    <Image Source="ImageName.jpg" Width="144" Height="144"/>
    <Canvas x:Name="Layer_2" Width="150" Height="150" Canvas.Left="0" Canvas.Top="0">

  12. Badack Says:

    I have inserted an image like you said, but nothing happend:

    Have you an idea?

  13. Femmes Capitalisme Says:

    ehh. bookmarked !

  14. Vunder Says:

    comment…

    Спасибо за информацию !…

  15. Dmitry Says:

    ……

    Бизнесмен из Вас отличный…

  16. Vasya Says:

    < a href=”http://avto-himki.ru/ ycihisv@xienaoy.ru” >1< / a >…

    no more…

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.