better and faster window resize; Add "AllowsTransparency" to plugin interface; Use IPreviewHandler for Office files

This commit is contained in:
Paddy Xu
2017-05-21 22:02:42 +03:00
parent e0a7f38d58
commit e450971217
36 changed files with 533 additions and 409 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Runtime.InteropServices;
using System.Windows.Controls;
namespace QuickLook.Plugin.IPreviewHandlers
{
/// <summary>
/// Interaction logic for PreviewPanel.xaml
/// </summary>
public partial class PreviewPanel : UserControl, IDisposable
{
private PreviewHandlerHost _control = new PreviewHandlerHost();
public PreviewPanel()
{
InitializeComponent();
}
public void Dispose()
{
presenter.Child = null;
presenter?.Dispose();
_control?.Dispose();
_control = null;
}
public void PreviewFile(string file)
{
_control = new PreviewHandlerHost();
presenter.Child = _control;
_control.Open(file);
SetActiveWindow(presenter.Handle);
}
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetActiveWindow(IntPtr hWnd);
}
}