public void PreviewFile(string file, ContextObject context) { _control = new PreviewHandlerHost(); Child = _control; _control.Open(file); //SetForegroundWindow(new WindowInteropHelper(context.ViewerWindow).Handle); //SetActiveWindow(presenter.Handle); }
public void Dispose() { Application.Current.Dispatcher.BeginInvoke(new Action(() => { Child = null; _control?.Dispose(); _control = null; base.Dispose(); })); }
public bool CanHandle(string path) { if (Directory.Exists(path)) { return(false); } if (Extensions.Any(path.ToLower().EndsWith)) { return(PreviewHandlerHost.GetPreviewHandlerGUID(path) != Guid.Empty); } return(false); }