Skip to content

Commit ed70585

Browse files
authored
Fixed an issue where "Set as desktop background" would sometimes show on the context menu for shortcut files. (#1665)
1 parent a3eb151 commit ed70585

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Files/View Models/SelectedItemsPropertiesViewModel.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ public bool IsSelectedItemShortcut
515515

516516
public async void CheckFileExtension()
517517
{
518+
// Set properties to false
519+
IsSelectedItemImage = false;
520+
IsSelectedItemShortcut = false;
521+
518522
//check if the selected item is an image file
519523
string ItemExtension = await CoreApplication.MainView.ExecuteOnUIThreadAsync(() => App.CurrentInstance.ContentPage.SelectedItem.FileExtension);
520524
if (!string.IsNullOrEmpty(ItemExtension) && SelectedItemsCount == "1 " + ResourceController.GetTranslation("ItemSelected/Text"))
@@ -526,19 +530,13 @@ public async void CheckFileExtension()
526530
{
527531
// Since item is an image, set the IsSelectedItemImage property to true
528532
IsSelectedItemImage = true;
529-
return;
530533
}
531534
else if (ItemExtension.Equals(".lnk", StringComparison.OrdinalIgnoreCase))
532535
{
533536
// The selected item is a shortcut, so set the IsSelectedItemShortcut property to true
534537
IsSelectedItemShortcut = true;
535-
return;
536538
}
537539
}
538-
539-
// Since item is not an image, shortcut, folder or file without extension, set the properties to false
540-
IsSelectedItemImage = false;
541-
IsSelectedItemShortcut = false;
542540
}
543541

544542
private string _ShortcutItemType;

0 commit comments

Comments
 (0)