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.
3 Answers, 1 is accepted
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)?
Regards,
Martin
Telerik
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.
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