I spent a lot of time trying to figure out a way to run the Windows 8 Developer Preview in a virtual machine so that I could write code using its bundled version of Visual Studio 11 Express and the then-current version of the Windows Runtime (WinRT) APIs. But I needn’t have bothered: as it turns out, a basic Windows 10 Universal Windows Platform (UWP) app created using the most recent version of Visual Studio at the time of this writing—2022—is nearly identical from a software code perspective.
To prove this, I examined the code that Charles Petzold provided for his first, hello world-style Windows 8 app in the book Programming Windows Sixth Edition. And then I compared that code to the code that Visual Studio 2022 generates when you create a new, blank UWP app.
Here’s the Petzold code for MainPage.xaml:
<Page
x:Class="Hello.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Hello"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
</Grid>
</Page>
And here’s the Visual Studio 2022/UWP code:
<Page
x:Class="Hello.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Hello"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
</Grid>
</Page>
As you can see, the differences are minor: the code that sets the background color has moved from the <Grid> level to the <Page> level, and instead of being a static resource, it’s now a theme resource. But the Windows 8/Petzold code still works if you want to make that change for some reason.
If you run this blank app as-is in Windows 10/11, you will get a floating app window because Microsoft moved past the Windows 8 full-screen app requirement very quickly.

But you can force the app to emulate Windows 8 by adding a single line of code to the app constructor in app.xaml.cs:
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
Now, the app runs full screen as it would have in Windows 8. (Though it remains blank of course.)

Petzold added a TextBlock inside of the Grid in MainPage.xaml to accomplish the “Hello, world!” nature of this simple app:
<TextBlock Text="Hello, Windows 8!" FontFamily="Times New Roman" FontSize="96" FontStyle="Italic" Foreground="Yellow" HorizontalAlignment="Center" VerticalAlignment="Center"/>
And that code works perfectly well in Windows 10/11/UWP too. Well, sort of.

The issue here is that Windows 8 did not support Light and Dark modes as does Windows 10/11, and so the theming code used in MainPage.xaml will create a light background if you’re using Light mode and a dark background otherwise. There’s probably a more elegant way to fix that, but I just hard-coded a dark background color in MainPage.xaml by changing that background color code to “{StaticResource SystemAccentColorDark1}”.
And with that change, the app looks as Petzold intended:

That’s cute for something this basic, but if you dive deeper into Microsoft’s developer documentation of the day, or into the subsequent chapters of Programming Windows Sixth Edition, you’ll find many differences between WinRT and today’s UWP (and the even newer Windows App SDK). Most are tied to the strategy changes that occurred when Windows 8 failed, and Microsoft tried to adapt the platform to work better on non “touch-first” devices. Or what we might call traditional PCs.
Consider one example.
In lieu of the menus and toolbars that traditional Windows desktop applications used to present commands to the user, Windows 8 introduced simpler UI constructs, among them a so-called application bar, or app bar, that typically sat at the bottom of the screen, might be hidden by default, and grouped circular buttons on its far left and right sides, so that they would be easy to reach when the user held the PC—presumed to be a tablet—normally. (There were also context menus and pop-up dialogs.)
The Windows 8 app bar control is still available in UWP, go figure, but it’s been superseded by the newer command bar control, which offers denser control layouts and the ability to mix and match buttons and other controls with overflow menu items, among other changes. I used the command bar control in the UWP version of my .NETpad app.
With technology shaping our everyday lives, how could we not dig deeper?
Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.