

Gets or sets the type of the disappear animation. Gets or sets the parameter to pass to the Command property. Gets or sets the command to invoke when the submit button is clicked or the enter key is pressed. Gets or sets the hint which will be displayed when CapsLock is active. Gets or sets the additional user information which will be displayed under the UserName with a smaller font size. With a smaller font size and a opacity of 0.6. Gets or sets the additional system information which will be displayed under the AdditionalUserInfo This is a dependency property (BindsTwoWayByDefault). Gets or sets the password which will be accepted by the intern validation process. Initializes a new instance of the SmartLoginOverlay class. The SmartLoginOverlay type exposes the following members : Constructors List of all class members SmartLoginOverlay Class The XAML Code for this approach would look like this :Īnd if you want to handle the password validation on your own in codeīehind just leave the AccessPassword unset and assign an eventĪll three approaches are shown in the demo application.Validation or validate the password in code behind (forĮverybody who is not familiar with MVVM or don't wanna use it) Assign fixed values to the properties and let the control do the.Return !string.IsNullOrEmpty( this.Password ) Private bool CanExecuteSubmit( object commandParameter) If ( ( this.UserPassword ))ĪccessControlSystem.ShowWrongCredentialsMessage() Var accessControlSystem = commandParameter as SmartLoginOverlay This.UserName + " \n" + this.EMailAddress + " \n" + this.Password ) Private void ExecuteSubmit( object commandParameter)ĭebug.WriteLine( " Here you would implement the submission and a following validation of this data:\n" + Password validation will be performed automatically by the user controlĬopy Code // - // Put this in the constructor of your ViewModel class this.SubmitCommand = new ActionCommand( this.ExecuteSubmit, this.CanExecuteSubmit )


Therefore I ask you to please be considerate if anything should not be perfect. There is also a fully functional RevealButton implemented (like in the Windows 8įurthermore there is a hint when CapsLock is active (the text is customizable) :Ī few days earlier I have implemented and written an article about a Smart Password Box in my blog ( Windows 8 PasswordBox Style for WPF).Īfter this was made I decided to make it a little bit smarter and style it like the If you try to sign in with wrong credentials you will get this behaviour (the text is customizable) : If you try to sign in with no credentials you will get this behaviour (the text is customizable) : Hereinafter are some screenshots of the control in action so you can see what I'm I have made several Screenshots of the Windows 8 Login Screen and try to imitate it as good as possible. especially the PasswordBox - has the same visual styles and behaviour like the All code changes can be found here.įurthermore i have added a second Demo to demonstrate this new functionalityįor everbody who is interested in a lightweight user validation control (for WPFĪpplications) I have implemented a Smart Login Overlay WPF Control. Only in this way it is guaranteed that an user switch is easy as it Download WPFSmartLibraryLight Source Code -Īn option for entering the user name, I decided to implement thisĪm also of the opinion that it makes more senseīoth : the user name and the password.
