Show busy indicator while doing a background job using WindowsFormsHost?

2 posts, 0 answers
  1. Adnan
    Adnan avatar
    15 posts
    Member since:
    Sep 2013

    Posted 09 Jan Link to this post

    <telerik:RadBusyIndicator IsIndeterminate="True" Grid.Row="1" Grid.ColumnSpan="2" IsBusy="False" x:Name="MainIndicator">
        <Grid x:Name="grdChart">
             <WindowsFormsHost Name="host" Background="Black" >
             </WindowsFormsHost>
         </Grid>
    </telerik:RadBusyIndicator>

     

    public void ActiveXControlDataLoaded()
    {
        this.Dispatcher.BeginInvoke(new System.Action(() =>
        {
               MainIndicator.IsBusy = true;
        }));
    }

     

    The above XAML code is showing WindowsFormsHost element that is used to host an ActiveX control.

    ActiveXControlDataLoaded method will be fired by the ActiveX control whenever it has a new data record.

    My problem is RadBusyIndicator is always getting behind WindowsFormsHost element when the later UI is loaded. I tried to disable WindowsFormsHost and Its ActiveX control child but RadBusyIndicator keeps disappearing. Is there any way to show RadBusyIndicator on top of WindowsFormsHost ?

    Thanks in advance.

  2. Nasko
    Admin
    Nasko avatar
    700 posts

    Posted 11 Jan Link to this post

    Hi Adnan,

    The observed by you behavior is an expected one when WindowsFormsHost is used in WPF project. The WinForms controls are always displayed on top of the the WPF control and this is a known limitation of the the Framework - it could be reproduced with any WPF control.

    Some more information about the limitation you could find on the following link:
    https://blogs.msdn.microsoft.com/dwayneneed/2013/02/26/mitigating-airspace-issues-in-wpf-applications/

    As this is a limitation of the Framework not of the BusyIndicator we could not suggest you any proper approach how to resolve it.

    We hope the provided information will be helpful for you.

    Regards,
    Nasko
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top