Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>for the splash screen you will simply Add New Item / Splash Screen. a .png file will be added to your project , you are then free to edit it or replace it with another .png file with the same name.</p> <p>for the login screen, ShowDialog() it on your Main Window viewmodel constructor, then handle the close event of the login Window to shutdown the application if user not verified and to just close if the user verified ( I'm using a static class to save global values, like the user Id, depends on it I choose wheather to shutdown the application or to let it load ) , it varies how one would implement ShowDialog() and Close() methods in the viewModel, I suppose you already figured it out, see this viewmodel of my Login Window</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Input; using GlassStoreBLL; using System.Windows; namespace GlassStore.ViewModels { class LoginViewModel:ViewModelBase { private String _UserName; private String _Password; private String _richMessage; private Commands.RelayCommand _login; private Commands.RelayCommand _closing; private IDialogueService _dialogService; private String _errorMessage; public LoginViewModel() : this(new DialogueService()) { } public LoginViewModel(IDialogueService dialogueService) { _dialogService = dialogueService; GlobalClass.userID = 0; } public String richMessage { get { return _richMessage; } set { if (_richMessage != value) { _richMessage = value; OnPropertyChanged("richMessage"); } } } public String Password { get { return _Password; } set { if (_Password != value) { _Password = value; OnPropertyChanged("Password"); } } } public String UserName { get { return _UserName; } set { if (_UserName != value) { _UserName = value; OnPropertyChanged("UserName"); } } } public String errorMessage { get { return _errorMessage; } set { if (_errorMessage != value) { _errorMessage = value; OnPropertyChanged("errorMessage"); } } } public ICommand login { get { if (_login == null) { _login = new Commands.RelayCommand(param =&gt; CanLogin(), param =&gt; Login()); } return _login; } } public ICommand closing { get { if (_closing == null) { _closing = new Commands.RelayCommand(param =&gt; CanClosing(), param =&gt; Closing()); } return _closing; } } private bool CanClosing() { return true; } private void Closing() { if (GlobalClass.userID == 0) { Application.Current.Shutdown(); } else { } } private bool CanLogin() { return !String.IsNullOrEmpty(UserName) &amp;&amp; !String.IsNullOrEmpty(Password); } private void Login() { try { User usr1 = new User(); usr1 = usr1.userExists(UserName, Password); if (usr1.id == 0) { errorMessage = "اسم المستخدم أو كلمة السر أو الاثنان خطأ"; } else { GlobalClass.userID = usr1.id; if (usr1.manager == "true") { GlobalClass.manager = true; } else { GlobalClass.manager = true; } var windows = Application.Current.Windows; for (var i = 0; i &lt; windows.Count; i++) { if (windows[i].DataContext == this) _dialogService.Close(windows[i]); } } } catch (Exception d) { errorMessage = "خـطـأ"; richMessage = d.Message; } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload