0
我有我的用戶控制凍結問題。當我觸發WindowsFormsHost預覽PDF文件時發生。 PDF文件仍然在WindowsFormsHost中運行,我仍然可以滾動查看它。但是,我的其他控件(togglebutton,popupbox等)似乎並沒有工作。WPF控件凍結後WindowsFormsHost觸發器查看PDF
這裏是我的用戶
<Grid Margin="0,0,203,0">
<WindowsFormsHost x:Name="ViewPDFWinForm" HorizontalAlignment="Left" Height="444" VerticalAlignment="Top" Width="708"/>
</Grid>
這裏WindowsFormsHost的XAML代碼被觸發WindowsFormsHost從用戶控件
PreviewReportPDF uc = new PreviewReportPDF(ReportGenerator.ReportPath);
this.ViewPDFWinForm.Child = uc;
這裏叫PDF文件中的代碼是我通過PDF文件路徑
public PreviewReportPDF(string filepath)
{
InitializeComponent();
this.axAcroPDF1.LoadFile(filepath);
this.axAcroPDF1.setZoom(63);
}
我在這裏發佈這個問題之前完成了這個例子。如果僅僅是這個代碼,我可以運行程序。但是,當我嘗試與我的主程序結合使用時,像我在問題中聲明的控件凍結而沒有發生任何錯誤。我想我會繼續尋找錯誤的地方。順便說一句,謝謝你的例子。它可能會幫助其他人。當我稍後解決時,我會在這裏分享解決方案。 – OreaSedap