Ejemplo n.º 1
0
 private void OnSelectedFileChanged(object sender, EventArgs e)
 {
     if (_selectedIndex != filesList.SelectedIndex)
     {
         if (IsDirty)
         {
             var answer = _appShell.ShowMessage(Resources.SettingsPage_SavePrompt, MessageButtons.YesNoCancel);
             if (answer == MessageButtons.Cancel)
             {
                 filesList.SelectedIndex = _selectedIndex;
                 return;
             }
             else if (answer == MessageButtons.Yes)
             {
                 _viewModel.SaveAsync().DoNotWait();
             }
         }
         _selectedIndex = filesList.SelectedIndex;
         IsDirty        = true;
         LoadPropertyGrid();
     }
 }