0

有什么好的方法可以以双向模式绑定静态类的静态属性吗?

这是一个示例类:

 static class SettingsModel
 {
        static public string ModelFolder { set; get; }
 }

和一个文本框:

<TextBox x:Name="ModelTB" Text="{Binding Source={x:Static local:SettingsModel.ModelFolder}, Mode=TwoWay, Path=???/>

我一直在寻找很多,我发现只有 2 个不是很好的答案:Make class not static or create a dummy window resource class。

4

0 回答 0