我创建了一个ResourceDictionary文件来存储 aPage的背景颜色。接下来,我ResourceDictionary在我的主页中引用了它。
虽然 Visual Studio 2019 (16.7.7) 设计器正确地将Page的背景颜色呈现为红色,但正在运行的程序本身却没有。

我究竟做错了什么?
以下是来源:
主页.xaml
<Page
x:Class="Test1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary1.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Page.Resources>
<StackPanel>
<TextBlock>
Test
</TextBlock>
</StackPanel>
</Page>
Dictionary1.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Style TargetType="Page">
<Setter Property="Background" Value="Red" />
</Style>
</ResourceDictionary>