GamePadState.IsConnected Property

Indicates whether the Xbox 360 Controller is connected.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public bool IsConnected { get; }

Property Value

true if the controller is connected; false otherwise.

When calling GetState or GetCapabilities, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state and/or capabilities will not be valid. The controller will also not be able to receive new vibration settings.

Xbox 360, Windows XP SP2, Windows Vista, Zune

Community Additions