How to get a TextBox in a Windows 8 app to support auto-capitalization

Unlike with most platforms, TextBox controls in Windows 8 metro apps default to a lowercase keyboard instead of assuming that the first word of a sentence should be capitalized. This can be frustrating for users of virtual keyboards who would rather use less keystrokes and let the OS take care of basic formatting. The fix for this is non-obvious, but fortunately quite simple. The solution consists of making sure that spell check is enabled for the TextBox.

This can be done either in XAML with

<TextBox IsSpellCheckEnabled="True" />

or in C# with

TextBox tb = new TextBox();
tb.IsSpellCheckEnabled = true;