/// <summary> /// Initializes a new instance of the <see cref="LogOn" /> class. /// </summary> /// <param name="mode">The mode.</param> public LogOn(LogOnMode mode) { this.logOnViewModel = new LogOnViewModel(mode); this.DataContext = this.logOnViewModel; this.InitializeComponent(); this.RegisterEvents(); }
/// <summary> /// Initializes a new instance of the <see cref="LogOnViewModel" /> class. /// </summary> /// <param name="mode">The mode.</param> public LogOnViewModel(LogOnMode mode) { this.LogOnMode = mode; if (LogOnMode == LogOnMode.Lock) { this.LogOn.UserName = this.workstation.User.UserName; this.LogOn.Password = string.Empty; Messenger.Instance.Notify(MessengerMessage.StopBarcode); } if (LogOnMode == LogOnMode.SwitchUser) { this.LogOn.UserName = string.Empty; this.LogOn.Password = string.Empty; Messenger.Instance.Notify(MessengerMessage.StopBarcode); } this.DisplayApplicationInfo(); }