> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# ConnectionStatusEventArgs

## Definition

**ConnectionStatusEventArgs** contains **Connection**-related information to be passed as an argument to the **[OnConnectionStatusUpdate()](/developer/desktop-sdk/references/common/onconnectionstatusupdate)** event.

For a complete, working example of this class in use, download framework example located on our [Developing AddOns Overview](/developer/desktop-sdk/guides/educational-resources/addon-development-overview).

The properties listed below are accessible from an instance of **ConnectionStatusEventArgs**:

| Property                | Description                                                                                                                             |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Connection**          | The Connection object for which **OnConnectionStatusUpdate()** was called                                                               |
| **Error**               | An **ErrorCode** thrown by the Connection object in question                                                                            |
| **NativeError**         | A string representing an error thrown by the connectivity provider                                                                      |
| **PreviousStatus**      | A **ConnectionStatus** object representing the status of the connection before this call to **OnConnectionStatusUpdate()**              |
| **Status**              | A **ConnectionStatus** object representing the new status of the connection                                                             |
| **PreviousPriceStatus** | A **ConnectionStatus** object representing the status of the connection's price feed before this call to **OnConnectionStatusUpdate()** |
| **PriceStatus**         | A **ConnectionStatus** object representing the new status of the connection's price feed                                                |

## Examples

```csharp
// This method is fired on connection status events
private void OnConnectionStatusUpdate(object sender, ConnectionStatusEventArgs e)
{
    // For multi-threading reasons, work with a copy of the ConnectionStatusEventArgs to prevent situations in which the EventArgs may already be ahead of us while in the middle processing it.
    // This accomplishes the same goal as locking a collection to prevent in-flight changes from affecting outcomes
    ConnectionStatusEventArgs eCopy = e;

    /* Dispatcher.InvokeAsync() is needed for multi-threading considerations. When processing events outside of the UI thread, and we want to
     influence the UI .InvokeAsync() allows us to do so. It can also help prevent the UI thread from locking up on long operations. */
    Dispatcher.InvokeAsync(() =>
    {
        outputBox.AppendText(string.Format("{1} Status: {2}",
                Environment.NewLine,
                eCopy.Connection.Options.Name,
                eCopy.Status));
    });   
}
```