private void OnLoginEvent(LoginEventArgs arg) { if (arg != null) { switch (arg.ActionType) { case "Login": { this.Name = IdentityUtility.GetLoggedInName(); this.UserName = IdentityUtility.GetLoggedInUserName(); this.Role = IdentityUtility.GetLoggedInUserRole(); this.IsLoggedIn = Visibility.Visible; break; } case "SignUp": { break; } case "Logout": { this.Name = "Anonymous"; this.UserName = "******"; this.Role = "NIL"; this.IsLoggedIn = Visibility.Collapsed; break; } } } }
public UserProfileFlyoutViewModel(UserManagementDb dbContext) { this.dbContext = dbContext; this.Name = IdentityUtility.GetLoggedInName(); this.UserName = IdentityUtility.GetLoggedInUserName(); this.Role = IdentityUtility.GetLoggedInUserRole(); InitializeCommands(); SubscribeEvents(); }