# Instance Events

# OnAfterStart

Description

This event fires when VideoSDK just started and is ready to receive commands. It is implemented in the TrueConfVideoSDK component.

public event Action OnAfterStart

Example

this.VideoSDKControl.OnAfterStart += VideoSDK_OnAfterStart;

...

private void VideoSDK_OnAfterStart()
{
    _sdk = this.VideoSDKControl.SDK;

    // Other initialization code
}

# OnClosingRequested

Description

This event fires when there was a closing request from VideoSDK. It is implemented in the TrueConfVideoSDK component.

public event Action OnClosingRequested

# OnAppStateChanged

Description

This event fires when AppState of VideoSDK has changed. It is implemented in the TrueConfVideoSDK.API.VideoSDK class.

public event EventHandler<AppStateChangedEventArgs> OnAppStateChanged

Response

public class AppStateChangedEventArgs : EventArgs
{
    public int NewState { get; set; }
    public int OldState { get; set; }
}
Field Description
NewState New application state
OldState Old application state

Example

using TrueConfVideoSDK.API;

public partial class MainPage : ContentPage
{
    private VideoSDK _sdk;
}

...

private void VideoSDK_OnAfterStart()
{
    _sdk = this.VideoSDKControl.SDK;
    
    _sdk.OnAppStateChanged += OnAppStateChanged;

    // Other initialization code
}

private void OnAppStateChanged(object? sender, AppStateChangedEventArgs e)
{
    switch (e.NewState)
    {
        case 0: // No connection to server
        case 1: // Trying to connect to server
            break;
        case 2: // Connected, need to log in
            _sdk.Methods.login(_trueConfId, _password);
            break;
        case 4: // In waiting (receiving an invite or calling someone)
        case 5: // In conference
            ActionBtn.Text = "Reject";
            break;
        default:
            ActionBtn.Text = "Call";
            break;
    }
}

# OnError

Description

This event fires when there was an error in processing a VideoSDK request

public event EventHandler<string> OnError

See also

Last Updated: 12/22/2025