protected override void OnNavigatedTo(NavigationEventArgs eventArgs) { base.OnNavigatedTo(eventArgs); // Add item jumping handler App.AppSettings.LayoutModeChangeRequested += AppSettings_LayoutModeChangeRequested; Window.Current.CoreWindow.CharacterReceived += Page_CharacterReceived; var parameters = (string)eventArgs.Parameter; if (App.AppSettings.FormFactor == Enums.FormFactorMode.Regular) { Frame rootFrame = Window.Current.Content as Frame; InstanceTabsView instanceTabsView = rootFrame.Content as InstanceTabsView; instanceTabsView.TabStrip_SelectionChanged(null, null); } App.CurrentInstance.NavigationToolbar.CanRefresh = true; IsItemSelected = false; AssociatedViewModel.EmptyTextState.isVisible = Visibility.Collapsed; App.CurrentInstance.ViewModel.Universal.WorkingDirectory = parameters; if (App.CurrentInstance.ViewModel.Universal.WorkingDirectory == Path.GetPathRoot(App.CurrentInstance.ViewModel.Universal.WorkingDirectory)) { App.CurrentInstance.NavigationToolbar.CanNavigateToParent = false; } else { App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true; } App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.Universal.WorkingDirectory); App.Clipboard_ContentChanged(null, null); App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters; }
public PhotoAlbum() { this.InitializeComponent(); EmptyTextPA = EmptyText; PAPageName = PhotoAlbumViewer; gv = FileList; progressBar = ProgBar; gridContext = GridRightClickContextMenu; Clipboard.ContentChanged += Clipboard_ContentChanged; Frame rootFrame = Window.Current.Content as Frame; InstanceTabsView instanceTabsView = rootFrame.Content as InstanceTabsView; instanceTabsView.TabStrip_SelectionChanged(null, null); tabInstance = App.selectedTabInstance; if (tabInstance.instanceViewModel == null && tabInstance.instanceInteraction == null) { tabInstance.instanceViewModel = new ItemViewModel(); tabInstance.instanceInteraction = new Interaction(); } viewModelInstance = tabInstance.instanceViewModel; FileList.DoubleTapped += tabInstance.instanceInteraction.List_ItemClick; SidebarPinItem.Click += tabInstance.instanceInteraction.PinItem_Click; OpenTerminal.Click += tabInstance.instanceInteraction.OpenDirectoryInTerminal; OpenInNewWindowItem.Click += tabInstance.instanceInteraction.OpenInNewWindowItem_Click; OpenInNewTab.Click += tabInstance.instanceInteraction.OpenDirectoryInNewTab_Click; NewFolder.Click += tabInstance.instanceInteraction.NewFolder_Click; NewBitmapImage.Click += tabInstance.instanceInteraction.NewBitmapImage_Click; NewTextDocument.Click += tabInstance.instanceInteraction.NewTextDocument_Click; UnzipItem.Click += tabInstance.instanceInteraction.ExtractItems_Click; }
public GenericFileBrowser() { this.InitializeComponent(); GFBPageName = GenericItemView; emptyTextGFB = EmptyText; progressBar = progBar; progressBar.Visibility = Visibility.Collapsed; data = AllView; context = RightClickContextMenu; HeaderContextMenu = HeaderRightClickMenu; grid = RootGrid; Clipboard.ContentChanged += Clipboard_ContentChanged; RefreshEmptySpace.Click += NavigationActions.Refresh_Click; Frame rootFrame = Window.Current.Content as Frame; InstanceTabsView instanceTabsView = rootFrame.Content as InstanceTabsView; instanceTabsView.TabStrip_SelectionChanged(null, null); tabInstance = App.selectedTabInstance; if (tabInstance.instanceViewModel == null && tabInstance.instanceInteraction == null) { tabInstance.instanceViewModel = new ItemViewModel(); tabInstance.instanceInteraction = new Interaction(); } viewModelInstance = tabInstance.instanceViewModel; PasteEmptySpace.Click += tabInstance.instanceInteraction.PasteItem_ClickAsync; OpenItem.Click += tabInstance.instanceInteraction.OpenItem_Click; ShareItem.Click += tabInstance.instanceInteraction.ShareItem_Click; DeleteItem.Click += tabInstance.instanceInteraction.DeleteItem_Click; RenameItem.Click += tabInstance.instanceInteraction.RenameItem_Click; CutItem.Click += tabInstance.instanceInteraction.CutItem_Click; CopyItem.Click += tabInstance.instanceInteraction.CopyItem_ClickAsync; SidebarPinItem.Click += tabInstance.instanceInteraction.PinItem_Click; OpenInNewTab.Click += tabInstance.instanceInteraction.OpenDirectoryInNewTab_Click; AllView.RightTapped += tabInstance.instanceInteraction.AllView_RightTapped; AllView.DoubleTapped += tabInstance.instanceInteraction.List_ItemClick; OpenTerminal.Click += tabInstance.instanceInteraction.OpenDirectoryInTerminal; NewFolder.Click += tabInstance.instanceInteraction.NewFolder_Click; NewBitmapImage.Click += tabInstance.instanceInteraction.NewBitmapImage_Click; NewTextDocument.Click += tabInstance.instanceInteraction.NewTextDocument_Click; PropertiesItem.Click += tabInstance.ShowPropertiesButton_Click; OpenInNewWindowItem.Click += tabInstance.instanceInteraction.OpenInNewWindowItem_Click; }
protected override async void OnNavigatedTo(NavigationEventArgs eventArgs) { base.OnNavigatedTo(eventArgs); // Add item jumping handler AppSettings.LayoutModeChangeRequested += AppSettings_LayoutModeChangeRequested; Window.Current.CoreWindow.CharacterReceived += Page_CharacterReceived; var parameters = (string)eventArgs.Parameter; if (AppSettings.FormFactor == Enums.FormFactorMode.Regular) { Frame rootFrame = Window.Current.Content as Frame; InstanceTabsView instanceTabsView = rootFrame.Content as InstanceTabsView; instanceTabsView.TabStrip_SelectionChanged(null, null); } App.CurrentInstance.NavigationToolbar.CanRefresh = true; IsItemSelected = false; AssociatedViewModel.IsFolderEmptyTextDisplayed = false; await App.CurrentInstance.FilesystemViewModel.SetWorkingDirectory(parameters); // pathRoot will be empty on recycle bin path string pathRoot = Path.GetPathRoot(App.CurrentInstance.FilesystemViewModel.WorkingDirectory); if (string.IsNullOrEmpty(pathRoot) || App.CurrentInstance.FilesystemViewModel.WorkingDirectory == pathRoot) { App.CurrentInstance.NavigationToolbar.CanNavigateToParent = false; } else { App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true; } App.CurrentInstance.InstanceViewModel.IsPageTypeNotHome = true; // show controls that were hidden on the home page App.CurrentInstance.InstanceViewModel.IsPageTypeRecycleBin = App.CurrentInstance.FilesystemViewModel.WorkingDirectory.StartsWith(App.AppSettings.RecycleBinPath); App.CurrentInstance.InstanceViewModel.IsPageTypeMtpDevice = App.CurrentInstance.FilesystemViewModel.WorkingDirectory.StartsWith("\\\\?\\"); App.CurrentInstance.FilesystemViewModel.RefreshItems(); App.Clipboard_ContentChanged(null, null); App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters; }
protected override void OnNavigatedTo(NavigationEventArgs eventArgs) { base.OnNavigatedTo(eventArgs); // Add item jumping handler Window.Current.CoreWindow.CharacterReceived += Page_CharacterReceived; var parameters = (string)eventArgs.Parameter; if (App.FormFactor == Enums.FormFactorMode.Regular) { Frame rootFrame = Window.Current.Content as Frame; InstanceTabsView instanceTabsView = rootFrame.Content as InstanceTabsView; instanceTabsView.TabStrip_SelectionChanged(null, null); } App.OccupiedInstance.RibbonArea.Refresh.IsEnabled = true; App.OccupiedInstance.AlwaysPresentCommands.isEnabled = true; AssociatedViewModel.EmptyTextState.isVisible = Visibility.Collapsed; App.OccupiedInstance.instanceViewModel.Universal.path = parameters; if (App.OccupiedInstance.instanceViewModel.Universal.path == Path.GetPathRoot(App.OccupiedInstance.instanceViewModel.Universal.path)) { App.OccupiedInstance.RibbonArea.Up.IsEnabled = false; } else { App.OccupiedInstance.RibbonArea.Up.IsEnabled = true; } App.OccupiedInstance.instanceViewModel.AddItemsToCollectionAsync(App.OccupiedInstance.instanceViewModel.Universal.path); App.Clipboard_ContentChanged(null, null); if (parameters.Equals(App.DesktopPath)) { App.OccupiedInstance.PathText.Text = "Desktop"; } else if (parameters.Equals(App.DocumentsPath)) { App.OccupiedInstance.PathText.Text = "Documents"; } else if (parameters.Equals(App.DownloadsPath)) { App.OccupiedInstance.PathText.Text = "Downloads"; } else if (parameters.Equals(App.PicturesPath)) { App.OccupiedInstance.PathText.Text = "Pictures"; } else if (parameters.Equals(App.MusicPath)) { App.OccupiedInstance.PathText.Text = "Music"; } else if (parameters.Equals(App.OneDrivePath)) { App.OccupiedInstance.PathText.Text = "OneDrive"; } else if (parameters.Equals(App.VideosPath)) { App.OccupiedInstance.PathText.Text = "Videos"; } else { if (parameters.Equals(@"C:\") || parameters.Equals(@"c:\")) { App.OccupiedInstance.PathText.Text = @"Local Disk (C:\)"; } else { App.OccupiedInstance.PathText.Text = parameters; } } }