public FileProperties(SelectedItemsPropertiesViewModel viewModel, CancellationTokenSource tokenSource, CoreDispatcher coreDispatcher, IProgress <float> hashProgress, ListedItem item, IShellPage instance) { ViewModel = viewModel; TokenSource = tokenSource; Dispatcher = coreDispatcher; Item = item; AppInstance = instance; this.hashProgress = hashProgress; GetBaseProperties(); ViewModel.PropertyChanged += ViewModel_PropertyChanged; }
public BaseLayout() { SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this); DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel(); // QuickLook Integration ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; var isQuickLookIntegrationEnabled = localSettings.Values["quicklook_enabled"]; if (isQuickLookIntegrationEnabled != null && isQuickLookIntegrationEnabled.Equals(true)) { IsQuickLookEnabled = true; } }
public FileSystemProperties(SelectedItemsPropertiesViewModel viewModel, CancellationTokenSource tokenSource, CoreDispatcher coreDispatcher, ListedItem item, IShellPage instance) { ViewModel = viewModel; TokenSource = tokenSource; Dispatcher = coreDispatcher; Item = item; AppInstance = instance; GetBaseProperties(); ViewModel.EditOwnerCommand = new RelayCommand(() => EditOwner(), () => ViewModel.FilePermissions != null); ViewModel.AddRulesForUserCommand = new RelayCommand(() => AddRulesForUser(), () => ViewModel.FilePermissions != null && ViewModel.FilePermissions.CanReadFilePermissions); ViewModel.RemoveRulesForUserCommand = new RelayCommand(() => RemoveRulesForUser(), () => ViewModel.FilePermissions != null && ViewModel.FilePermissions.CanReadFilePermissions && ViewModel.SelectedRuleForUser != null); }
protected override void OnNavigatedTo(NavigationEventArgs e) { ViewModel = new SelectedItemsPropertiesViewModel(); var np = e.Parameter as Properties.PropertyNavParam; var listedItem = np.navParameter as ListedItem; if (listedItem.PrimaryItemAttribute == StorageItemTypes.File) { BaseProperties = new FileProperties(ViewModel, np.tokenSource, Dispatcher, null, listedItem); } SetOverviewVisibilities(); base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { ViewModel = new SelectedItemsPropertiesViewModel(e.Parameter as ListedItem); if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { Loaded += Properties_Loaded; } else { this.OKButton.Visibility = Visibility.Collapsed; } ViewModel.ItemMD5HashProgress = ItemMD5HashProgress; ViewModel.Dispatcher = Dispatcher; App.AppSettings.ThemeModeChanged += AppSettings_ThemeModeChanged; base.OnNavigatedTo(e); }
public ConfirmDeleteDialog(bool deleteFromRecycleBin, StorageDeleteOption deleteOption, SelectedItemsPropertiesViewModel propertiesViewModel) { this.InitializeComponent(); Result = MyResult.Nothing; //clear the result in case the value is set from last time PermanentlyDelete = deleteOption; SelectedItemsPropertiesViewModel = propertiesViewModel; // If deleting from recycle bin disable "permanently delete" option chkPermanentlyDelete.IsEnabled = !deleteFromRecycleBin; if (SelectedItemsPropertiesViewModel.SelectedItemsCount == 1) { Description = "ConfirmDeleteDialogDeleteOneItem/Text".GetLocalized(); } else { Description = string.Format("ConfirmDeleteDialogDeleteMultipleItems/Text".GetLocalized(), SelectedItemsPropertiesViewModel.SelectedItemsCount); } }
public BaseLayout() { ItemManipulationModel = new ItemManipulationModel(); HookEvents(); jumpTimer = new DispatcherTimer(); jumpTimer.Interval = TimeSpan.FromSeconds(0.8); jumpTimer.Tick += JumpTimer_Tick; SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this); DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel(); // QuickLook Integration ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; var isQuickLookIntegrationEnabled = localSettings.Values["quicklook_enabled"]; if (isQuickLookIntegrationEnabled != null && isQuickLookIntegrationEnabled.Equals(true)) { App.InteractionViewModel.IsQuickLookEnabled = true; } dragOverTimer = DispatcherQueue.GetForCurrentThread().CreateTimer(); }
public static List <ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayoutCommandsViewModel commandsViewModel, List <ListedItem> selectedItems, SelectedItemsPropertiesViewModel selectedItemsPropertiesViewModel) { return(new List <ContextMenuFlyoutItemViewModel>() { new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutRestore/Text".GetLocalized(), Glyph = "\uE8E5", Command = commandsViewModel.RestoreItemCommand, ShowInRecycleBin = true, ShowItem = selectedItems.All(x => x.IsRecycleBinItem) }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenItem/Text".GetLocalized(), Glyph = "\uE8E5", Command = commandsViewModel.OpenItemCommand, IsPrimary = true, ShowItem = selectedItems.Count <= 10, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCreateFolderWithSelection/Text".GetLocalized(), Glyph = "\uE1DA", Command = commandsViewModel.CreateFolderWithSelection, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenItemWith/Text".GetLocalized(), Glyph = "\uE17D", Command = commandsViewModel.OpenItemWithApplicationPickerCommand, ShowItem = selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.File && !i.IsShortcutItem), }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenFileLocation/Text".GetLocalized(), Glyph = "\uE8DA", Command = commandsViewModel.OpenFileLocationCommand, ShowItem = selectedItems.All(i => i.IsShortcutItem), }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenInNewPane/Text".GetLocalized(), Glyph = "\uF117", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.OpenDirectoryInNewPaneCommand, ShowItem = App.AppSettings.IsDualPaneEnabled && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder), SingleItemOnly = true, IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenInNewTab/Text".GetLocalized(), Glyph = "\uF113", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.OpenDirectoryInNewTabCommand, ShowItem = selectedItems.Count < 5 && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenInNewWindow/Text".GetLocalized(), Glyph = "\uE737", Command = commandsViewModel.OpenInNewWindowItemCommand, ShowItem = selectedItems.Count < 5 && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutSetAs/Text".GetLocalized(), ShowItem = selectedItemsPropertiesViewModel.IsSelectedItemImage, Items = new List <ContextMenuFlyoutItemViewModel>() { new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutSetAsDesktopBackground/Text".GetLocalized(), Glyph = "\uE91B", Command = commandsViewModel.SetAsDesktopBackgroundItemCommand, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutSetAsLockscreenBackground/Text".GetLocalized(), Glyph = "\uF114", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.SetAsLockscreenBackgroundItemCommand, }, } }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutRunAsAdmin/Text".GetLocalized(), Glyph = "\uE7EF", Command = commandsViewModel.RunAsAdminCommand, ShowItem = new string[] { ".bat", ".exe", "cmd" }.Contains(selectedItems.FirstOrDefault().FileExtension) }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutRunAsAnotherUser/Text".GetLocalized(), Glyph = "\uE7EE", Command = commandsViewModel.RunAsAnotherUserCommand, ShowItem = new string[] { ".bat", ".exe", "cmd" }.Contains(selectedItems.FirstOrDefault().FileExtension) }, new ContextMenuFlyoutItemViewModel() { Text = "ContextMenuMoreItemsLabel".GetLocalized(), Glyph = "\xE712", ID = "ItemOverflow" }, new ContextMenuFlyoutItemViewModel() { ItemType = ItemType.Separator, ShowInRecycleBin = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCut/Text".GetLocalized(), Glyph = "\uE8C6", Command = commandsViewModel.CutItemCommand, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.X, Modifiers = Windows.System.VirtualKeyModifiers.Control, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCopy/Text".GetLocalized(), Glyph = "\uE8C8", Command = commandsViewModel.CopyItemCommand, ShowInRecycleBin = true, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.C, Modifiers = Windows.System.VirtualKeyModifiers.Control, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCopyLocation/Text".GetLocalized(), Glyph = "\uE167", Command = commandsViewModel.CopyPathOfSelectedItemCommand, SingleItemOnly = true, IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutPaste/Text".GetLocalized(), Glyph = "\uE16D", Command = commandsViewModel.PasteItemsFromClipboardCommand, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder), SingleItemOnly = true, IsEnabled = App.InteractionViewModel.IsPasteEnabled, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.V, Modifiers = Windows.System.VirtualKeyModifiers.Control, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutShortcut/Text".GetLocalized(), Glyph = "\uF10A", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.CreateShortcutCommand, ShowItem = !selectedItems.FirstOrDefault().IsShortcutItem, SingleItemOnly = true, IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutDelete/Text".GetLocalized(), Glyph = "\uE74D", Command = commandsViewModel.DeleteItemCommand, ShowInRecycleBin = true, IsPrimary = true, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.Delete, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutRename/Text".GetLocalized(), Glyph = "\uE8AC", Command = commandsViewModel.RenameItemCommand, SingleItemOnly = true, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.F2, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutShare/Text".GetLocalized(), Glyph = "\uE72D", Command = commandsViewModel.ShareItemCommand, ShowItem = DataTransferManager.IsSupported() && !selectedItems.Any(i => i.IsHiddenItem), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutPinToSidebar/Text".GetLocalized(), Glyph = "\uE840", Command = commandsViewModel.SidebarPinItemCommand, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsPinned), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutUnpinDirectoryFromSidebar/Text".GetLocalized(), Glyph = "\uE77A", Command = commandsViewModel.SidebarUnpinItemCommand, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && x.IsPinned), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "PinItemToStart/Text".GetLocalized(), Glyph = "\uE840", Command = commandsViewModel.PinItemToStartCommand, ShowOnShift = true, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsItemPinnedToStart), SingleItemOnly = true, }, new ContextMenuFlyoutItemViewModel() { Text = "UnpinItemFromStart/Text".GetLocalized(), Glyph = "\uE77A", Command = commandsViewModel.UnpinItemFromStartCommand, ShowOnShift = true, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && x.IsItemPinnedToStart), SingleItemOnly = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutProperties/Text".GetLocalized(), Glyph = "\uE946", Command = commandsViewModel.ShowPropertiesCommand, } }); }
public static List <ContextMenuFlyoutItemViewModel> GetItemContextCommands(NamedPipeAsAppServiceConnection connection, CurrentInstanceViewModel currentInstanceViewModel, string workingDir, List <ListedItem> selectedItems, BaseLayoutCommandsViewModel commandsViewModel, bool shiftPressed, bool showOpenMenu, SelectedItemsPropertiesViewModel selectedItemsPropertiesViewModel) { var menuItemsList = ShellContextmenuHelper.SetShellContextmenu(GetBaseItemMenuItems(commandsViewModel: commandsViewModel, selectedItems: selectedItems, selectedItemsPropertiesViewModel: selectedItemsPropertiesViewModel), shiftPressed: shiftPressed, showOpenMenu: showOpenMenu, connection: connection, workingDirectory: workingDir, selectedItems: selectedItems); menuItemsList = Filter(items: menuItemsList, shiftPressed: shiftPressed, currentInstanceViewModel: currentInstanceViewModel, selectedItems: selectedItems); return(menuItemsList); }
public FolderProperties(SelectedItemsPropertiesViewModel viewModel, CancellationTokenSource tokenSource, CoreDispatcher coreDispatcher, ListedItem item, IShellPage instance) : base(viewModel, tokenSource, coreDispatcher, item, instance) { ViewModel.PropertyChanged += ViewModel_PropertyChanged; }
public FileProperties(SelectedItemsPropertiesViewModel viewModel, CancellationTokenSource tokenSource, CoreDispatcher coreDispatcher, IProgress <float> hashProgress, ListedItem item, IShellPage instance) : base(viewModel, tokenSource, coreDispatcher, item, instance) { this.hashProgress = hashProgress; ViewModel.PropertyChanged += ViewModel_PropertyChanged; }
public static List <ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(BaseLayoutCommandsViewModel commandsViewModel, List <ListedItem> selectedItems, SelectedItemsPropertiesViewModel selectedItemsPropertiesViewModel) { return(new List <ContextMenuFlyoutItemViewModel>() { new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutRestore/Text".GetLocalized(), Glyph = "\uE8E5", Command = commandsViewModel.RestoreItemCommand, ShowInRecycleBin = true, ShowItem = selectedItems.All(x => x.IsRecycleBinItem) }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenItem/Text".GetLocalized(), Glyph = "\uE8E5", Command = commandsViewModel.OpenItemCommand, IsPrimary = true, ShowItem = selectedItems.Count <= 10, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCreateFolderWithSelection/Text".GetLocalized(), ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0033", OverlayLayerGlyph = "\u0034" }, Command = commandsViewModel.CreateFolderWithSelection, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenItemWith/Text".GetLocalized(), Glyph = "\uE17D", Command = commandsViewModel.OpenItemWithApplicationPickerCommand, CollapseLabel = true, ShowItem = selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.File && !i.IsShortcutItem), }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenFileLocation/Text".GetLocalized(), Glyph = "\uE8DA", Command = commandsViewModel.OpenFileLocationCommand, ShowItem = selectedItems.All(i => i.IsShortcutItem), }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenInNewPane/Text".GetLocalized(), Glyph = "\uF117", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.OpenDirectoryInNewPaneCommand, ShowItem = App.AppSettings.IsDualPaneEnabled && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder), SingleItemOnly = true, IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenInNewTab/Text".GetLocalized(), Glyph = "\uF113", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.OpenDirectoryInNewTabCommand, ShowItem = selectedItems.Count < 5 && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutOpenInNewWindow/Text".GetLocalized(), Glyph = "\uE737", Command = commandsViewModel.OpenInNewWindowItemCommand, ShowItem = selectedItems.Count < 5 && selectedItems.All(i => i.PrimaryItemAttribute == Windows.Storage.StorageItemTypes.Folder), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutSetAs/Text".GetLocalized(), ShowItem = selectedItemsPropertiesViewModel.IsSelectedItemImage, Items = new List <ContextMenuFlyoutItemViewModel>() { new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutSetAsDesktopBackground/Text".GetLocalized(), Glyph = "\uE91B", Command = commandsViewModel.SetAsDesktopBackgroundItemCommand, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutSetAsLockscreenBackground/Text".GetLocalized(), Glyph = "\uF114", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.SetAsLockscreenBackgroundItemCommand, }, } }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutRunAsAdmin/Text".GetLocalized(), Glyph = "\uE7EF", Command = commandsViewModel.RunAsAdminCommand, ShowItem = new string[] { ".bat", ".exe", "cmd" }.Contains(selectedItems.FirstOrDefault().FileExtension) }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutRunAsAnotherUser/Text".GetLocalized(), Glyph = "\uE7EE", Command = commandsViewModel.RunAsAnotherUserCommand, ShowItem = new string[] { ".bat", ".exe", "cmd" }.Contains(selectedItems.FirstOrDefault().FileExtension) }, new ContextMenuFlyoutItemViewModel() { ItemType = ItemType.Separator, ShowInRecycleBin = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCut/Text".GetLocalized(), Glyph = "\uE8C6", Command = commandsViewModel.CutItemCommand, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.X, Modifiers = Windows.System.VirtualKeyModifiers.Control, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCopy/Text".GetLocalized(), //Glyph = "\uE8C8", ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0021", OverlayLayerGlyph = "\u0022", }, Command = commandsViewModel.CopyItemCommand, ShowInRecycleBin = true, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.C, Modifiers = Windows.System.VirtualKeyModifiers.Control, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutCopyLocation/Text".GetLocalized(), ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u002F", OverlayLayerGlyph = "\u0030" }, Command = commandsViewModel.CopyPathOfSelectedItemCommand, SingleItemOnly = true, IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutPaste/Text".GetLocalized(), //Glyph = "\uE16D", ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0023", OverlayLayerGlyph = "\u0024", }, Command = commandsViewModel.PasteItemsFromClipboardCommand, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder), SingleItemOnly = true, IsEnabled = App.MainViewModel.IsPasteEnabled, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.V, Modifiers = Windows.System.VirtualKeyModifiers.Control, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutShortcut/Text".GetLocalized(), Glyph = "\uF10A", GlyphFontFamilyName = "CustomGlyph", Command = commandsViewModel.CreateShortcutCommand, ShowItem = !selectedItems.FirstOrDefault().IsShortcutItem, SingleItemOnly = true, IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutDelete/Text".GetLocalized(), //Glyph = "\uE74D", ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0035", OverlayLayerGlyph = "\u0036" }, Command = commandsViewModel.DeleteItemCommand, ShowInRecycleBin = true, IsPrimary = true, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.Delete, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutRename/Text".GetLocalized(), //Glyph = "\uE8AC", ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0027", OverlayLayerGlyph = "\u0028", }, Command = commandsViewModel.RenameItemCommand, SingleItemOnly = true, KeyboardAccelerator = new KeyboardAccelerator { Key = Windows.System.VirtualKey.F2, IsEnabled = false, }, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutShare/Text".GetLocalized(), //Glyph = "\uE72D", ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0025", OverlayLayerGlyph = "\u0026", }, Command = commandsViewModel.ShareItemCommand, ShowItem = DataTransferManager.IsSupported() && !selectedItems.Any(i => i.IsHiddenItem), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutExtractionOptions".GetLocalized(), Glyph = "\xF11A", ShowItem = selectedItems.Count == 1 && selectedItems.First().PrimaryItemAttribute == StorageItemTypes.File && new [] { ".zip", ".msix", ".msixbundle" }.Contains(selectedItems.First().FileExtension.ToLowerInvariant()), GlyphFontFamilyName = "CustomGlyph", Items = new List <ContextMenuFlyoutItemViewModel>() { new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutExtractFilesOption".GetLocalized(), Command = commandsViewModel.DecompressArchiveCommand, Glyph = "\xF11A", GlyphFontFamilyName = "CustomGlyph" }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutExtractHereOption".GetLocalized(), Command = commandsViewModel.DecompressArchiveHereCommand, Glyph = "\xF11A", GlyphFontFamilyName = "CustomGlyph" }, new ContextMenuFlyoutItemViewModel() { Text = string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalized(), Path.GetFileNameWithoutExtension(selectedItems.First().ItemName)), Command = commandsViewModel.DecompressArchiveToChildFolderCommand, Glyph = "\xF11A", GlyphFontFamilyName = "CustomGlyph" } } }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutPinToFavorites/Text".GetLocalized(), Glyph = "\uE840", Command = commandsViewModel.SidebarPinItemCommand, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsPinned), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutContextFlyoutUnpinFromFavorites/Text".GetLocalized(), Glyph = "\uE77A", Command = commandsViewModel.SidebarUnpinItemCommand, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && x.IsPinned), IsPrimary = true, }, new ContextMenuFlyoutItemViewModel() { Text = "PinItemToStart/Text".GetLocalized(), Glyph = "\uE840", Command = commandsViewModel.PinItemToStartCommand, ShowOnShift = true, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsItemPinnedToStart), SingleItemOnly = true, }, new ContextMenuFlyoutItemViewModel() { Text = "UnpinItemFromStart/Text".GetLocalized(), Glyph = "\uE77A", Command = commandsViewModel.UnpinItemFromStartCommand, ShowOnShift = true, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && x.IsItemPinnedToStart), SingleItemOnly = true, }, new ContextMenuFlyoutItemViewModel() { Text = "BaseLayoutItemContextFlyoutProperties/Text".GetLocalized(), //Glyph = "\uE946", ColoredIcon = new ColoredIconModel() { BaseLayerGlyph = "\u0031", OverlayLayerGlyph = "\u0032" }, Command = commandsViewModel.ShowPropertiesCommand, }, new ContextMenuFlyoutItemViewModel() { ItemType = ItemType.Separator, Tag = "OverflowSeparator", IsHidden = true, }, new ContextMenuFlyoutItemViewModel() { Text = "ContextMenuMoreItemsLabel".GetLocalized(), Glyph = "\xE712", ID = "ItemOverflow", Tag = "ItemOverflow", IsHidden = true, }, }); }
public static List <ContextMenuFlyoutItemViewModel> GetItemContextCommandsWithoutShellItems(CurrentInstanceViewModel currentInstanceViewModel, string workingDir, List <ListedItem> selectedItems, BaseLayoutCommandsViewModel commandsViewModel, bool shiftPressed, bool showOpenMenu, SelectedItemsPropertiesViewModel selectedItemsPropertiesViewModel) { var menuItemsList = GetBaseItemMenuItems(commandsViewModel: commandsViewModel, selectedItems: selectedItems, selectedItemsPropertiesViewModel: selectedItemsPropertiesViewModel); menuItemsList = Filter(items: menuItemsList, shiftPressed: shiftPressed, currentInstanceViewModel: currentInstanceViewModel, selectedItems: selectedItems, removeOverflowMenu: false); return(menuItemsList); }