Handle the busy status during async/long running operations
<AdornerDecorator>
<Grid behaviors:BusyStatusManager.Status="{Binding Path=IsBusy, Converter={converters:BooleanBusyStatusConverter}}">
<behaviors:BusyStatusManager.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Ellipse x:Name="ellipse" StrokeThickness="6" Width="30" Height="30" RenderTransformOrigin="0.5,0.5">
<Ellipse.Resources>
<Storyboard x:Key="SpinAnimation" RepeatBehavior="Forever">
<DoubleAnimation To="359"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" />
</Storyboard>
</Ellipse.Resources>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource SpinAnimation}"/>
</EventTrigger>
</Ellipse.Triggers>
<Ellipse.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Ellipse.RenderTransform>
<Ellipse.Stroke>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Red" Offset="0"/>
<GradientStop Color="#FF1442BF" Offset="1"/>
</LinearGradientBrush>
</Ellipse.Stroke>
</Ellipse>
<Button IsEnabled="{Binding Path=ThresholdElapsed}" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="1" Content="Waited tooooo long, cancel..." Command="{markup:AutoCommandBinding Path=CancelWork}" />
</Grid>
</behaviors:BusyStatusManager.Content>
<Button Content="Click me!" Command="{markup:AutoCommandBinding Path=WorkAsync}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="70" Height="23"/>
</Grid>
</AdornerDecorator>PreviousBi-directional communication between different windows/viewsNextImplement a customer improvement program
Last updated