IRemoteProxiedUserControlClient.SetDataContextAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.