Beispiel #1
0
        private static void ForwardCommandHandler(object parameter)
        {
            var filesItemView = parameter as FileItemsView;
            var lastDirectory = FileBrowserHistory.GetTopForwardHistory();

            if (lastDirectory == String.Empty)
            {
                filesItemView.SetDataContext(new FileItemsViewModel());
            }
            else
            {
                filesItemView.SetDataContext(new FileItemsViewModel(new DirectoryRecord()
                {
                    Info = new DirectoryInfo(lastDirectory)
                }));
            }
            FileBrowserHistory.PushBackHistory(FileBrowserHistory.PopForwardHistory());
            // filesItemView.LoadImagesAsync();
        }
Beispiel #2
0
        public void OnItemDoubleClicked(object sender, MouseEventArgs args)
        {
            var selectedFileItem = (sender as FrameworkElement).DataContext as FileSystemItem;

            if (selectedFileItem.Type == FileItemType.Directory || selectedFileItem.Type == FileItemType.Drive)
            {
                FileBrowserHistory.PushBackHistory(selectedFileItem.FullName);
                if (FileBrowserHistory.ForwardHistoryCount() > 0 && selectedFileItem.FullName == FileBrowserHistory.GetTopForwardHistory())
                {
                    FileBrowserHistory.PopForwardHistory();
                }
                SetDataContext(new FileItemsViewModel(new DirectoryRecord()
                {
                    Info = new DirectoryInfo(selectedFileItem.FullName)
                }));
            }
        }