Introducing XPF – A Layout Framework for XNA

Update (2012-07-05):  We’re very proud to announce the public beta of XPF – a layout framework for XNA on Windows & Windows Phone 7. For too long performing 2D layouts in XNA has been an arduous task, the simplest of layouts often produces verbose and inelegant code. If you’ve come from a WPF/Silverlight background, where fluid and logical layouts are second nature, the inability to combine XNA with WPF and/or Silverlight only compounds the frustration. With XPF, Red Badger is addressing this problem.

Familiar Development Experience

XPF has been specifically designed to be familiar to WPF & Silverlight developers and comes with a collection of out of the box controls, that can be composed together to create flexible layouts in no time at all. The beta launches with the following controls:

  • Border
  • Button
  • ContentControl
  • Grid
  • Image
  • ItemsControl
  • RootElement (similar to Window)
  • ScrollViewer
  • ScrollContentPresenter
  • StackPanel
  • TextBlock

XPF also supports Dependency Properties, Attached Properties, Animation (currently WP7 only) and Data Binding (one and two-way).

Pure XNA

XPF is designed to run in a pure XNA application, it doesn’t host XNA inside a WPF or Silverlight application. All the controls have been written from the ground-up to work in XNA 4.0 and fit into XNA’s Update & Draw game loop.


XPF has been designed to be modular and extensible in two key ways. Firstly, creating custom controls to use alongside the controls you get out of the box is easy. If you’ve ever created a custom control in WPF or Silverlight, using the 2 phase measure and arrange layout system, then XPF gives an almost identical experience.

Secondly, the integration point between XPF and your XNA application has been designed to be extremely flexible. XPF doesn’t really know anything about XNA, it’s written entirely around agnostic interfaces – so whilst XPF comes with a renderer that you can use out the box, should you want to create your own, or integrate to an existing engine, you simply have to satisfy a few core interfaces.

Try It

As XPF reaches completion we’re looking for early adopters, testers and feedback. Nightly builds of XPF for Windows and Windows Phone 7 are now available for you to try. Download a build and read the Getting Started blog now!

We’d really love to hear what you have to say – leave a comment, shoot us an email or find us on twitter @redbadgerteam.

Sign up to Badger News