BusyIndicator on Backstage

4 posts, 0 answers
  1. Doug
    Doug avatar
    7 posts
    Member since:
    May 2013

    Posted 12 Apr Link to this post

    When using a RadBusyIndicator on a RadBackStageItem I receive the following error.

     

    Dispatcher Unhandled Exception.
    OnCurrentTimeInvalidated
    Cannot animate the 'Opacity' property on a 'System.Windows.Controls.ContentPresenter' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. For details see the inner exception.Line: 0Column: 0

     

    This happens on a dispatcher thread after the background thread has finished and I set the IsBusy to false.

  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 15 Apr Link to this post

    Hi Doug,

    I wasn't able to reproduce the described behavior. Can you give me more information about the error?
    • Where the busy indicator is defined?
    • What is the strack trace of the exception and from which control is coming from?
    • How exactly and when you are changing the busy indicator's state (IsBuyse=false)?
    Also, runnable code snippets or a project will be very useful in reproducing the issue.

    Regards,
    Martin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Doug
    Doug avatar
    7 posts
    Member since:
    May 2013

    Posted 15 Apr Link to this post

    It is defined like this, though currently commented out.

     

     <telerik:RadRibbonBackstageItem Header="{x:Static properties:Resources.lblMissedRGCalls}" IsDefault="False">
                                    <!--<telerik:RadBusyIndicator Name="rgmissedBusy" IsBusy="False" BusyContent="Loading...Please Wait">-->

                                    <Grid Name="missedGrid" VerticalAlignment="Top">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <StackPanel Name="mrgStack" Margin="15 15 5 5" IsVisibleChanged="mrgStack_IsVisibleChanged">

                                            <TextBlock Margin="0 0 0 2" FontSize="14" FontWeight="Bold" Text="{x:Static properties:Resources.lblMissedRGCalls48}"/>

                                            <telerik:RadGridView Name="gvMissedRG" RowIndicatorVisibility="Collapsed" AlternationCount="0" ShowGroupPanel="True" ItemsSource="{Binding}" IsReadOnly="True" EnableColumnVirtualization="True" EnableRowVirtualization="True" Margin="2" FontSize="12" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MaxColumnWidth="200">
                                            </telerik:RadGridView>

                                        </StackPanel>
         
                                    </Grid>
                                    <!--</telerik:RadBusyIndicator>-->
                                    
                                </telerik:RadRibbonBackstageItem>

     

    When the stackpanel becomes visible I run a background thread to put some SQL data in the grid.

    At the end of that thread I would call.

     

     this.Dispatcher.BeginInvoke((Action)delegate ()
                    {
                        try
                        {
                rgmissedBusy.IsBusy = true;
                        }
                        catch
                        {

                        }
                    }, DispatcherPriority.ApplicationIdle);

     

    to stop the busy indicator.  A similar dispatcher thread is at the beginning of the thread to turn it on, and that works fine, it just never turns off, when the final code posted is called, your control errors with the message I posted in the first thread here.

  5. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 18 Apr Link to this post

    Hello Doug,

    Thank you for the code snippets. Based on them I prepared a small example in order to recreate the issue, but to no avail. Can you take a look at the attached project and let me know if I am missing something?

    Regards,
    Martin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top