SfAccordion not barely updated beside WindowsFormsHost

Hi,

we currently want to integrate a 3rd-party render engine into our WPF application. This is done via an WindowsFormsHost, which implements a custom user control to start the application, render our content, e.g. The WindowsFormsHost runs as fast as possible so the rendering is updated as frequent as possible as well.


We now face an issue, when we work with SfAccordion in the the same ChromelessWindow. For testing purposes I eliminated all unneccessary stuff, so that our WindowsFormsHost is rendered in the first grid column, the SfAccordion in the second column.


<Grid Grid.Row="2">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0">
        <WindowsFormsHost Visibility="{Binding RunNotInDesignMode}">
            <windowControl:EngineControl x:Name="EngineApp"/>
        </WindowsFormsHost>
    </Grid>
    <syncfusion:SfAccordion Grid.Column="1" MinWidth="400">
        <syncfusion:SfAccordionItem Header="Topic 1">
            <StackPanel Orientation="Vertical">
                <Label>Hello World</Label>
                <Label>Hello World</Label>
                <Label>Hello World</Label>
                <Label>Hello World</Label>
                <Label>Hello World</Label>
            </StackPanel>
        </syncfusion:SfAccordionItem>
        <syncfusion:SfAccordionItem Header="Topic 2">
            <StackPanel Orientation="Vertical">
                <Label>Hello World</Label>
                <Label>Hello World</Label>
                <Label>Hello World</Label>
                <Label>Hello World</Label>
                <Label>Hello World</Label>
            </StackPanel>
        </syncfusion:SfAccordionItem>
    </syncfusion:SfAccordion>
</Grid>


The issue is, that expanding/collapsing the SfAccordion is not done, when the user didn't hover over another syncfusion-item or another SfAccordionItem-Header. It doesn't matter, whether SfAccordion has two or fifteen items. While disabling the WindowsFormsHost, everything seems to work normally. Also WPF performance analyzer brings nothing special, beside WindowsFormsHost using all the rendering capacities (which is needed).

The issue does only happen on SfAccordion, the MenuBar e.g. doesn't seem to have this issue. For a better understanding, I attached a link to an video.

https://hidrive.ionos.com/lnk/5wMAinbi#file


Thanks in advance!



5 Replies

BS Bhaskar Suresh Syncfusion Team February 14, 2024 03:01 PM UTC

Hi Christian,


We were uable to reporduce the reported scenario based on the given information. Please refer to the attached sample.


Could you please share the information about the WindowsFormsHost and if you can, please provide a modified sample with the WindowsFormsHost installed so that we can analyze the issue better and provide a solution?


Regards,

Bhaskar Suresh


Attachment: SfAccordion_WPF_e3a07a5e.zip


CH Christian February 23, 2024 08:32 AM UTC

Hi Bhaskar,


yes, we can for sure provide you an modified sample. Is it okay to provide you the attachment link via an PN



BS Bhaskar Suresh Syncfusion Team February 23, 2024 03:31 PM UTC

Hi Christian,


 If you can able to share the sample as you have shared a demo video via an link, please share in that way.


Regards,

Bhaskar Suresh



CH Christian February 27, 2024 02:41 PM UTC

Hi Bashkar,


we found the root cause of the issue that doesn't have anything to do with syncfusion. So sorry for any inconvenience.


The render engine (or specifically WPF) will block the Dispatcher indefinetly when the embedded User control calls Invalidate() to often. In our case, the OnPaint()-method runs as fast as possible (which is good), while the Invalidate() seems to re-arrange the Dispatcher jobs in an inproper way (which is bad).

We solved our issue by using a new thread that runs the OnPaint-method within an Application.Current.Dispatcher.Invoke()-command, but delay that task for one millisecond afterwards.


Thanks again

Christian



BS Bhaskar Suresh Syncfusion Team replied to Christian Büttner February 27, 2024 05:15 PM UTC

Hi Christian,


We are glad that your reported issue has been solved. Hence, we are closing this thread. 

Please let us know if you need any other assistance. We are happy to assist you.


Regards,

Bhaskar Suresh


Loader.
Up arrow icon