How to work with the Silverlight BusyIndicator?
Silverlight BusyIndicator is not a new thing in Silverlight. It was first added in Silverlight 3 Toolkit in November 2009 release (if I am n...- Article authored by Kunal Chowdhury on .
Silverlight BusyIndicator is not a new thing in Silverlight. It was first added in Silverlight 3 Toolkit in November 2009 release (if I am n...- Article authored by Kunal Chowdhury on .
<StackPanel> <TextBlock Text="Silverlight Toolkit Busy Indicator Demo" FontSize="36" FontWeight="Bold" Foreground="Red" TextWrapping="Wrap" TextAlignment="Center"/> <Button x:Name="btnClick" Content="Click Here" Width="100" Height="25" Click="btnClick_Click"/> </StackPanel>
<Grid x:Name="LayoutRoot" Background="White"> <toolkit:BusyIndicator HorizontalAlignment="Center" VerticalAlignment="Center" Name="busyIndicator" IsBusy="False"> <StackPanel> <TextBlock Text="Silverlight Toolkit Busy Indicator Demo" FontSize="36" FontWeight="Bold" Foreground="Red" TextWrapping="Wrap" TextAlignment="Center"/> <Button x:Name="btnClick" Content="Click Here" Width="100" Height="25" Click="btnClick_Click"/> </StackPanel> </toolkit:BusyIndicator> </Grid>
/// <summary> /// Handles the Click event of the btnClick control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance /// containing the event data.</param> private void btnClick_Click(object sender, RoutedEventArgs e) { busyIndicator.IsBusy = true; //busyIndicator.BusyContent = "Fetching Data..."; ThreadPool.QueueUserWorkItem((state) => { Thread.Sleep(3 * 1000); Dispatcher.BeginInvoke(() => busyIndicator.IsBusy = false); }); }
busyIndicator.BusyContent = "Fetching Data...";
Thank you for visiting our website!
We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.
We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.