Skip to content
Snippets Groups Projects
Commit b0154635 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

accounts/UI: prevent deselection of an account

- removes the ability to deselect an account from the account
  listbox

Change-Id: Ie03eee41234727f760e2fb47cb1761e51c8c5af9
Tuleap: #1003
parent f6a10327
Branches
No related tags found
No related merge requests found
......@@ -180,6 +180,20 @@ void
SmartPanel::_accountList__SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
{
auto listbox = safe_cast<ListBox^>(sender);
// disable deselction from listbox
if (listbox->SelectedItem == nullptr)
{
if (e->RemovedItems->Size > 0)
{
Object^ itemToReselect = e->RemovedItems->GetAt(0);
for each (auto item in listbox->Items) {
if (item == itemToReselect) {
listbox->SelectedItem = itemToReselect;
continue;
}
}
}
}
auto account = safe_cast<Account^>(listbox->SelectedItem);
AccountsViewModel::instance->selectedAccount = account;
updatePageContent();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment