public UserEditWindow(UserData user) { InitializeComponent(); CurrentUser = user; this.DataContext = CurrentUser; UserPermissons = User.ParsePermission(user.Permissions.Split(' ')); isAdmin = user.Type == "Администратор" ? true : false; isAdmins = user.Type == "Администратор" ? true : false; PasswordBorder.Visibility = Visibility.Collapsed; LoginPlace.IsReadOnly = true; if (MainWindow.User.Type != "Администратор") { AdminTools.Visibility = Visibility.Hidden; } else { AdminTools.Visibility = Visibility.Visible; } if (isAdmin) { UserButton.UpdateColorToStart(); AdminButton.UpdateColorToEnd(); UserStatusControl.IsEnabled = false; } else { UserButton.UpdateColorToEnd(); AdminButton.UpdateColorToStart(); } }
private void UserButton_MouseDown(object sender, MouseButtonEventArgs e) { if (MainWindow.User.Type == "Администратор") { UserButton.UpdateColorToEnd(); AdminButton.UpdateColorToStart(); isAdmins = false; } }