共用方式為


VsShellUtilities.WhenPropertyChanged Method

Definition

Invokes a callback when a shell property next changes.

public:
[System::Runtime::CompilerServices::Extension]
 static IDisposable ^ WhenPropertyChanged(Microsoft::VisualStudio::Shell::Interop::IVsShell ^ shell, int propid, Action<System::Object ^> ^ callback);
public static IDisposable WhenPropertyChanged (this Microsoft.VisualStudio.Shell.Interop.IVsShell shell, int propid, Action<object> callback);
static member WhenPropertyChanged : Microsoft.VisualStudio.Shell.Interop.IVsShell * int * Action<obj> -> IDisposable
<Extension()>
Public Function WhenPropertyChanged (shell As IVsShell, propid As Integer, callback As Action(Of Object)) As IDisposable

Parameters

shell
IVsShell

The shell service.

propid
Int32

The property to listen for changes to.

callback
Action<Object>

The callback to invoke at most once when the property next changes.

Returns

A disposable that may cancel the subscription early.

Remarks

Must be called while on the main thread.

Applies to

See also