private void OnChangeUserDefinedToNotesRequested( IUserFilledSudokuBox userFilledSudokuBox) { if (userFilledSudokuBox == null) { return; } var foundViewModel = FindViewModel(userFilledSudokuBox.Coordinate, userFilledSudokuBox.ParentCoordinate) as UserFilledSudokuBoxViewModel; if (foundViewModel == null) { return; } // Replace user defined view model with predefined view model: var viewModelIndex = mSudokuBoxViewModels.IndexOf(foundViewModel); var numbersInSameGrid = GetAllNumbers((userFilledSudokuBox.ParentCoordinate, userFilledSudokuBox.Coordinate)); var remainingNumbers = mModelsFactoryService.SudokuNumbers().Except(numbersInSameGrid); var numbersInOtherGrids = mSudokuService.GetExistentNumbers( (userFilledSudokuBox.ParentCoordinate, userFilledSudokuBox.Coordinate)); if (numbersInOtherGrids != null) { remainingNumbers = remainingNumbers.Except(numbersInOtherGrids); } var newNoteViewModel = new NoteSudokuBoxViewModel( mModelsFactoryService.GetNoteSudokuBox( userFilledSudokuBox.Coordinate, userFilledSudokuBox.ParentCoordinate, new List <SudokuBoxNumbers>(remainingNumbers)), mSudokuService); mSudokuBoxViewModels.RemoveAt(viewModelIndex); mSudokuBoxViewModels.Insert(viewModelIndex, newNoteViewModel); RefreshValues(); SelectSingleAndUniqueNoteNumbers(GetAllNoteViewModels()); }