问一个wpf中x:static标签的问题

我在后台定义了静态变量

public partial class XStatic : Window
    {
        public static string title = "wo de title";
        public XStatic()
        {
            InitializeComponent();
        }
    }

xmal中使用x:static获取他

<StackPanel>
            <TextBox Text="{x:Static local:XStatic.title}"/>
 </StackPanel>

我的命名空间也是引入进来了

x:Class="X命名空间详解.XStatic"
        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:local="clr-namespace:X命名空间详解"
        mc:Ignorable="d"

但是他为什么一直报错,无法获取。

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^