I'm having problem with my User Control freeze. It's happen when I'm triggering the WindowsFormsHost to preview the PDF File. The pdf file still running in the WindowsFormsHost where i can still scroll to view it. However, my other controls(togglebutton,popupbox,etc) doesn't seems to work.
Here is the XAML code for WindowsFormsHost in my UserControl
<Grid Margin="0,0,203,0">
<WindowsFormsHost x:Name="ViewPDFWinForm" HorizontalAlignment="Left" Height="444" VerticalAlignment="Top" Width="708"/>
</Grid>
Here is the code to trigger the WindowsFormsHost to call PDF File from UserControl
PreviewReportPDF uc = new PreviewReportPDF(ReportGenerator.ReportPath);
this.ViewPDFWinForm.Child = uc;
Here is how I pass the pdf file path
public PreviewReportPDF(string filepath)
{
InitializeComponent();
this.axAcroPDF1.LoadFile(filepath);
this.axAcroPDF1.setZoom(63);
}
I have followed your example, as good as I could. I cannot see why you controls are freezing. It seems that the issue is located anywhere else.
I added the Acrobat Reader Control to a UserControl "UserControl1"
I created a WPF Window, like this:
and with this code behind
After the pdf file was loaded I could fire the Toggle Button Event, so Messagebox was shown. This is the reason why I gues your issue Comes from anywhere else.