BusyIndicator Kullanımı

Extended WPF Toolkit içinde işe yarayan birçok kontrol var. BusyIndicator kontrolü bunlardan sadece biri. Aşağıdaki gibi kullanılabilir.

<Grid>
   <extToolkit:BusyIndicator x:Name="_busyIndicator">
      <Button Click="Button_Click">Start Process</Button>
   </extToolkit:BusyIndicator>
</Grid>
private void Button_Click(object sender, RoutedEventArgs e)
{
   BackgroundWorker bw = new BackgroundWorker();
   bw.DoWork += (o, ea) =>
   {
      Thread.Sleep(3000);
   };
   bw.RunWorkerCompleted += (o, ea) =>
   {
      _busyIndicator.IsBusy = false;
   };
   _busyIndicator.IsBusy = true;
   bw.RunWorkerAsync();
}

Leave a Reply

Your email address will not be published. Required fields are marked *