@@ -1335,6 +1335,8 @@ void UpdateFromMenuSelection<T>(ComboBox comboBox, UserSettings.Menu_SelectionIn
1335
1335
1336
1336
void UpdateFromMenuSelection < T > ( ComboBox comboBox , UserSettings . Menu_SelectionIndex index , Func < T , string > map , T defaultValue )
1337
1337
{
1338
+ // if folder field, or the selected folder matches the menu selection setting
1339
+ // and there is a value in the menu selection setting
1338
1340
if ( ( ( index == UserSettings . Menu_SelectionIndex . Folder ) ||
1339
1341
( ( comboBoxFolder . Items . Count > 0 ) && ( SelectedFolder != null ) &&
1340
1342
( Settings . Menu_Selection . Count ( ) > 0 ) &&
@@ -1353,6 +1355,7 @@ void UpdateFromMenuSelection<T>(ComboBox comboBox, UserSettings.Menu_SelectionIn
1353
1355
}
1354
1356
else
1355
1357
{
1358
+ // if selected folder is in the content routes setting and has a start route
1356
1359
var routes = Settings . Content . ContentRouteSettings . Routes ;
1357
1360
if ( ( SelectedFolder != null ) &&
1358
1361
routes . ContainsKey ( SelectedFolder . Name ) &&
@@ -1390,30 +1393,37 @@ void UpdateFromMenuSelection<T>(ComboBox comboBox, UserSettings.Menu_SelectionIn
1390
1393
default :
1391
1394
break ;
1392
1395
}
1393
- bool found = false ;
1394
- if ( ( index != UserSettings . Menu_SelectionIndex . Path ) ||
1395
- ( SelectedActivity == null ) || ( ! ( SelectedActivity is ExploreActivity ) ) )
1396
+ if ( string . IsNullOrEmpty ( valueComboboxToSetTo ) )
1396
1397
{
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 ) ) )
1398
1405
{
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
+ }
1402
1416
else
1403
1417
{
1404
- found = searchInComboBox ( comboBox , valueComboboxToSetTo ) ;
1418
+ found = searchInComboBox ( comboBoxStartAt , valueComboboxToSetTo ) ;
1419
+ found = searchInComboBox ( comboBoxHeadTo , valueComboboxToSetTo ) ;
1405
1420
}
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 )
1415
1422
{
1416
- comboBox . SelectedIndex = 0 ;
1423
+ if ( comboBox . Items . Count > 0 )
1424
+ {
1425
+ comboBox . SelectedIndex = 0 ;
1426
+ }
1417
1427
}
1418
1428
}
1419
1429
}
0 commit comments