RemoteSystemSessionDisconnectedEventArgs RemoteSystemSessionDisconnectedEventArgs RemoteSystemSessionDisconnectedEventArgs RemoteSystemSessionDisconnectedEventArgs RemoteSystemSessionDisconnectedEventArgs Class

Definition

Contains information about a RemoteSystemSession.Disconnected event, namely the reason that this device was disconnected from the session.

public : sealed class RemoteSystemSessionDisconnectedEventArgs
struct winrt::Windows::System::RemoteSystems::RemoteSystemSessionDisconnectedEventArgs
public sealed class RemoteSystemSessionDisconnectedEventArgs
Public NotInheritable Class RemoteSystemSessionDisconnectedEventArgs
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)
Capabilities
remoteSystem

Examples

See the code example below for the process of joining a remote session (including using a RemoteSystemSessionDisconnectedEventArgs instance).


public async void JoinExistingSession() {
    
    // request to join. sessionInfo has already been selected by user.
    RemoteSystemSessionJoinResult joinResult = await sessionInfo.JoinAsync();
    
    // process the result
    if (joinResult.Status == RemoteSystemSessionJoinStatus.Success) {
        
        // if the join was successful, acquire a reference to the session
        currentSession = joinResult.Session;
        
        // optionally handle the disconnected event
        currentSession.Disconnected += async (sender, args) => {
            // update the UI, using args.Reason
        };
        
        // update the UI with the session.DisplayName and 
        // session.ControllerDisplayName strings. Save a reference to 
        // this RemoteSystemSession, to use when the user selects
        // this session from the UI

    } else {
        // join request failed. optionally update UI
    }
}

Remarks

This class is instantiated whenever the RemoteSystemSession.Disconnected event is raised, and it should be handled by the method(s) registered to this event.

Properties

Reason Reason Reason Reason Reason

Gets the reason this device was disconnected from the session.