Commit b0154635 authored by atraczyk's avatar atraczyk

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
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment