Exemplo n.º 1
0
 private void ClosePreview()
 {
     if (_previewWindow == null)
     {
         return;
     }
     _previewWindow.ContentRendered -= PreviewWindow_ContentRendered;
     _previewWindow.KeyDown         -= PreviewWindow_KeyDown;
     _previewWindow.Close();
     _previewWindow = null;
 }
Exemplo n.º 2
0
        private void TogglePreview()
        {
            if (_previewWindow != null)
            {
                _previewWindow.Close();
                return;
            }

            var allSelectedItems = GetDeepestSelection().Item2;
            var selectedFiles    = allSelectedItems.OfType <FileViewModel>().ToList();

            Log.Info($"Opening preview for {selectedFiles.Count} files (out of {allSelectedItems.Count} total selected items):");
            foreach (var file in selectedFiles.Take(1))
            {
                Log.Info($"  {file.Path}");
                _previewWindow = new FilePreviewWindow(file.Info);
                _previewWindow.ContentRendered += PreviewWindow_ContentRendered;
                _previewWindow.Show();
            }
        }