Cocktail Help Reference
BusyWatcher Class
Members  Example  See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace : BusyWatcher Class



Glossary Item Box

A service to manage a busy indicator

Object Model

BusyWatcher Class

Syntax

Visual Basic (Declaration) 
Public Class BusyWatcher 
   Inherits Caliburn.Micro.PropertyChangedBase
   Implements Caliburn.Micro.INotifyPropertyChangedEx, IBusyWatcher, IdeaBlade.Core.IHideObjectMembers 
Visual Basic (Usage)Copy Code
Dim instance As BusyWatcher
C# 
public class BusyWatcher : Caliburn.Micro.PropertyChangedBase, Caliburn.Micro.INotifyPropertyChangedEx, IBusyWatcher, IdeaBlade.Core.IHideObjectMembers  
C++/CLI 
public ref class BusyWatcher : public Caliburn.Micro.PropertyChangedBase, Caliburn.Micro.INotifyPropertyChangedEx, IBusyWatcher, IdeaBlade.Core.IHideObjectMembers  

Example

Demonstrates using the BusyWatcher in a ViewModel.
C#Copy Code
public class LoginViewModel
{
    public LoginViewModel()
    {
        Busy = new BusyWatcher();
    }
 
    public IBusyWatcher Busy { get; private set; }
 
    public async void Login()
    {
        using (Busy.GetTicket())
        {
            // Snip .. removed for clarity
            await _authenticationService.LoginAsync(credential);
 
            if (_authenticationService.IsLoggedIn)
                TryClose();
        }
    }
}
Demonstrates binding to the BusyWatcher.
XAMLCopy Code
<toolkit:BusyIndicator BorderBrush="#FF1D5380" IsBusy="{Binding Busy.IsBusy}">
    <toolkit:BusyIndicator.BusyContent>
        <TextBlock Text="Please wait" />
    </toolkit:BusyIndicator.BusyContent>
 
</toolkit:BusyIndicator>

Inheritance Hierarchy

System.Object
   Caliburn.Micro.PropertyChangedBase
      Cocktail.BusyWatcher

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.