Skip to content

Instantly share code, notes, and snippets.

@SchreinerK
Created August 19, 2024 09:29
Show Gist options
  • Save SchreinerK/40ccbea0a23dfb8e69a983e2cdb9b9ed to your computer and use it in GitHub Desktop.
Save SchreinerK/40ccbea0a23dfb8e69a983e2cdb9b9ed to your computer and use it in GitHub Desktop.
mc:AlternateContent, mc:Choice
using System.Windows.Markup;
#if NET8_0
[assembly: XmlnsDefinition("http://schemas.custom.com/net8/xaml", "KsWare.Presentation.Themes.Core.Net8")]
#endif
namespace KsWare.Presentation.Themes.Core.Net8 {class Dummy{} }
<Window
x:Class="Aeor2DarkTestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:net8="http://schemas.custom.com/net8/xaml"
mc:Ignorable="d net8"
>
<Grid>
<mc:AlternateContent>
<mc:Choice Requires="net8">
<TextBlock Text="This is .NET 8 or higher!"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="Green"/>
</mc:Choice>
<mc:Fallback>
<TextBlock Text="This is below .NET 8!"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="Red"/>
</mc:Fallback>
</mc:AlternateContent>
</Grid>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment