When you use the BackgroundWorker class, you can indicate operation progress, completion, and cancellation in the Silverlight/WPF user interface. For example, you can check whether the background operation is completed or canceled and display a message to the user.
XAML code in WPF for the same is here
- <Window x:Class="WpfDigital.BackGround"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="BackGround" Height="300" Width="300">
- <StackPanel>
- <Button Content="Thread Start" Width="75" Click="Thread_Click"/>
- <TextBlock x:Name="tbProgress" TextWrapping="Wrap" />
- <Button Content="Cencel" Width="75" Click="Cancel_Click"></Button>
- <Button Content="Other functionality is working" Width="75" Click="Other_Click"></Button>
- </StackPanel>
- </Window>
CS file of XAML


Join the conversation! Your thoughts help the community grow.