@@ -1335,6 +1335,8 @@ void UpdateFromMenuSelection<T>(ComboBox comboBox, UserSettings.Menu_SelectionIn
13351335
13361336 void UpdateFromMenuSelection < T > ( ComboBox comboBox , UserSettings . Menu_SelectionIndex index , Func < T , string > map , T defaultValue )
13371337 {
1338+ // if folder field, or the selected folder matches the menu selection setting
1339+ // and there is a value in the menu selection setting
13381340 if ( ( ( index == UserSettings . Menu_SelectionIndex . Folder ) ||
13391341 ( ( comboBoxFolder . Items . Count > 0 ) && ( SelectedFolder != null ) &&
13401342 ( Settings . Menu_Selection . Count ( ) > 0 ) &&
@@ -1353,6 +1355,7 @@ void UpdateFromMenuSelection<T>(ComboBox comboBox, UserSettings.Menu_SelectionIn
13531355 }
13541356 else
13551357 {
1358+ // if selected folder is in the content routes setting and has a start route
13561359 var routes = Settings . Content . ContentRouteSettings . Routes ;
13571360 if ( ( SelectedFolder != null ) &&
13581361 routes . ContainsKey ( SelectedFolder . Name ) &&
@@ -1390,30 +1393,37 @@ void UpdateFromMenuSelection<T>(ComboBox comboBox, UserSettings.Menu_SelectionIn
13901393 default :
13911394 break ;
13921395 }
1393- bool found = false ;
1394- if ( ( index != UserSettings . Menu_SelectionIndex . Path ) ||
1395- ( SelectedActivity == null ) || ( ! ( SelectedActivity is ExploreActivity ) ) )
1396+ if ( string . IsNullOrEmpty ( valueComboboxToSetTo ) )
13961397 {
1397- if ( comboBox . DropDownStyle == ComboBoxStyle . DropDown )
1398+ SetToDefault ( comboBox , index , map , defaultValue ) ;
1399+ }
1400+ else
1401+ {
1402+ bool found = false ;
1403+ if ( ( index != UserSettings . Menu_SelectionIndex . Path ) ||
1404+ ( SelectedActivity == null ) || ( ! ( SelectedActivity is ExploreActivity ) ) )
13981405 {
1399- comboBox . Text = valueComboboxToSetTo ;
1400- found = true ;
1401- }
1406+ if ( comboBox . DropDownStyle == ComboBoxStyle . DropDown )
1407+ {
1408+ comboBox . Text = valueComboboxToSetTo ;
1409+ found = true ;
1410+ }
1411+ else
1412+ {
1413+ found = searchInComboBox ( comboBox , valueComboboxToSetTo ) ;
1414+ }
1415+ }
14021416 else
14031417 {
1404- found = searchInComboBox ( comboBox , valueComboboxToSetTo ) ;
1418+ found = searchInComboBox ( comboBoxStartAt , valueComboboxToSetTo ) ;
1419+ found = searchInComboBox ( comboBoxHeadTo , valueComboboxToSetTo ) ;
14051420 }
1406- }
1407- else
1408- {
1409- found = searchInComboBox ( comboBoxStartAt , valueComboboxToSetTo ) ;
1410- found = searchInComboBox ( comboBoxHeadTo , valueComboboxToSetTo ) ;
1411- }
1412- if ( ! found )
1413- {
1414- if ( comboBox . Items . Count > 0 )
1421+ if ( ! found )
14151422 {
1416- comboBox . SelectedIndex = 0 ;
1423+ if ( comboBox . Items . Count > 0 )
1424+ {
1425+ comboBox . SelectedIndex = 0 ;
1426+ }
14171427 }
14181428 }
14191429 }
0 commit comments