private void CheckActive(Models.GetUsersModel obj) { if (obj.Active) { obj.ActiveIcon = new SymbolIcon(Symbol.BlockContact); obj.ActiveString = "Aktywny"; } else { obj.ActiveIcon = new SymbolIcon(Symbol.AddFriend); obj.ActiveString = "Nieaktywny"; } }
private void Edit_Click(object sender, RoutedEventArgs e) { IsEnabled = false; Button button = sender as Button; ListViewItem lvi = FindParent <ListViewItem>(button); lvi.IsSelected = true; Models.GetUsersModel userObj = new Models.GetUsersModel { UserName = usersList[UsersList.SelectedIndex].UserName, Name = usersList[UsersList.SelectedIndex].Name, Surname = usersList[UsersList.SelectedIndex].Surname, Email = usersList[UsersList.SelectedIndex].Email, Active = usersList[UsersList.SelectedIndex].Active, Role = usersList[UsersList.SelectedIndex].Role, Id = usersList[UsersList.SelectedIndex].Id }; EditOrAddUser(JsonConvert.SerializeObject(userObj)); IsEnabled = true; }