Share via


IRemoteProxiedUserControlClient.SetDataContextAsync Method

Definition

Notifies the client of the value of the datacontext. This method is called when client requests the control definition by invoking a method like InitializeAsync(IRemoteProxiedUserControlClient, CancellationToken).

public System.Threading.Tasks.Task SetDataContextAsync (Microsoft.VisualStudio.RpcContracts.RemoteUI.MessagePackFragment value, System.Threading.CancellationToken cancellationToken);
abstract member SetDataContextAsync : Microsoft.VisualStudio.RpcContracts.RemoteUI.MessagePackFragment * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SetDataContextAsync (value As MessagePackFragment, cancellationToken As CancellationToken) As Task

Parameters

value
MessagePackFragment

The current value of the datacontext.

cancellationToken
CancellationToken

Cancellation token for the async call.

Returns

A Task tracking the completion of the async operation.

Remarks

We don't send the object value as a result of a method like InitializeAsync(IRemoteProxiedUserControlClient, CancellationToken) because we cannot guarantee proper ordering of handling of async method results. We can guarantee ordering of execution of StreamJsonRpc methods, so all object values and updates are always sent as method parameters, never as method results.

Applies to