Share via


UIContext Class

Definition

Represents the active state of a UIContext.

public ref class UIContext sealed : System::ComponentModel::INotifyPropertyChanged
public ref class UIContext sealed : Microsoft::VisualStudio::Shell::Interop::IVsShellPropertyEvents, System::ComponentModel::INotifyPropertyChanged
public sealed class UIContext : System.ComponentModel.INotifyPropertyChanged
public sealed class UIContext : Microsoft.VisualStudio.Shell.Interop.IVsShellPropertyEvents, System.ComponentModel.INotifyPropertyChanged
public sealed class UIContext : Microsoft.VisualStudio.Shell.Interop.IVsUIContextEvents, System.ComponentModel.INotifyPropertyChanged
type UIContext = class
    interface INotifyPropertyChanged
type UIContext = class
    interface INotifyPropertyChanged
    interface IVsShellPropertyEvents
type UIContext = class
    interface INotifyPropertyChanged
    interface IVsUIContextEvents
Public NotInheritable Class UIContext
Implements INotifyPropertyChanged
Public NotInheritable Class UIContext
Implements INotifyPropertyChanged, IVsShellPropertyEvents
Public NotInheritable Class UIContext
Implements INotifyPropertyChanged, IVsUIContextEvents
Inheritance
UIContext
Implements

Properties

Guid

Gets the Guid used to create this UIContext.

IsActive

Returns the current state of the UIContext whether it is active or not.

IsZombie

Gets a value indicating whether this UIContext is a zombie. This can be true when VS is in command line mode or /updateConfiguration.

Methods

FromUIContextGuid(Guid)

Constructs a UIContext instance identified with the given guid.

GetAwaiter()

Method that enables UIContexts going to true (activated) to be awaited on. The awaiter resumes the caller on the same context, i.e., If the caller was on the UI thread when awaited, the code after the await would resume on the UI thread.

OnShellPropertyChange(Int32, Object)
WhenActivated(Action)

Execute the given action if the context is active. If the context is not currently active, the action will be executed when it is first activated. The action executes at most once.

Events

PropertyChanged

Event that fires when the IsActive property changes values.

UIContextChanged

Event that fires whenever the UIContext becomes active or inactive.

Explicit Interface Implementations

IVsUIContextEvents.OnContextChanged(Guid, Boolean)

Our context changed callback handler. This handles both changes to the Guid we represent, as well as changes to ShellInitialized_guid (which might also be the Guid we represent).

Applies to