My initial implementation of the XboxController class was based on
https://github.com/robotdotnet/WPILi...xController.cs. I replaced the base classes with GamepadBase and JoystickBase to deduplicate the implementations of Joystick and XboxController.
I also wrote a button state tracker for Joysticks a few years ago that I submitted this year (
https://github.com/wpilibsuite/allwpilib/pull/89). It's intended to be used with SampleRobot since Command-based robots already have the capability to run commands upon button state edges (see the ButtonScheduler commands). It wasn't merged in time for 2017 because we had other concerns to focus on for release. It uses raw button numbers, so using it for an XboxController wouldn't be clean. Perhaps an enum could be used to map the button names (A, B, X, Y) to the raw button number.