private void UpdateIssueOnList(object sender, ExecutedRoutedEventArgs e)
        {
            int i = 0;

            while (listOfTasks.SelectedIndex != i)
            {
                i++;
            }
            if (tasksList[i].Description.Length < 3 || tasksList[i].Description == null)
            {
                MessageBox.Show("Opis musi mieć przynajmniej 3 znaki.", "Opis", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else if (tasksList[i].Title.Length < 3 || tasksList[i].Title == null)
            {
                MessageBox.Show("Tytuł musi mieć przynajmniej 3 znaki.", "Tytuł", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                MessageBoxResult result = MessageBox.Show("Czy na pewno chcesz zaktulizować wybrane zadanie?", "Aktualizacja zadania", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    Issue taskToUpdate = issueRepository.Get(tasksList[i].IssueID);
                    var   status       = (Status)CurrentStatus.SelectedValue;
                    var   priority     = (Priority)CurrentPriority.SelectedValue;
                    var   assignee     = (Account)CurrentAssignee.SelectedValue;

                    //taskToUpdate.Status = issueRepository.GetStatus(status.StatusID);
                    taskToUpdate.StatusID = status.StatusID;

                    //taskToUpdate.Priority = issueRepository.GetPriority(priority.PriorityID);
                    taskToUpdate.PriorityID = priority.PriorityID;

                    //taskToUpdate.Assignee = accountRepository.Get(assignee.AccountID);
                    taskToUpdate.AssigneeID = assignee.AccountID;

                    taskToUpdate.Description = tasksList[i].Description;
                    taskToUpdate.Title       = tasksList[i].Title;

                    issueRepository.Edit(taskToUpdate);

                    tasksList.Clear();
                    foreach (var task in issueRepository.GetGroupIssues(group.GroupID))
                    {
                        tasksList.Add(new IssueDetailsVM
                        {
                            IssueID      = task.IssueID,
                            Title        = task.Title,
                            Description  = task.Description,
                            Assignee     = task.Assignee.Name + ' ' + task.Assignee.Surname,
                            PriorityName = task.Priority.Name,
                            StatusName   = task.Status.Name
                        });
                    }

                    //Issue currentIssue = issueRepository.Get(taskToUpdate.IssueID);
                    //tasksList.Remove(currentIssue);



                    listOfTasks.ItemsSource = tasksList;
                    listOfTasks.Items.Refresh();
                    MessageBox.Show("Zadanie zostało zaktualizowane.", "Aktualizacja zadania", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
        }