我正在尝试将一些控件的字体大小(以及其他属性)设置为用户控件级别的字体大小。但是这并没有生效:
<UserControl x:Class="TestWpfApplication1.Scratch.UserControlFontSizeProp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<TextBlock
FontSize="{Binding RelativeSource={RelativeSource self},Path=FontSize}">
Text
</TextBlock>
</Grid>
</UserControl>
我做错了什么?谢谢。