0
我有这个xaml块,我制作了一个ViewModel,它包含一个名为MyBrush的属性。我想将网格背景设置为该属性,但此块不起作用。你能告诉我我该怎么做?从样式中绑定的问题
<Style x:Key="myKey" TargetType="myType">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="myType">
<Grid Background="{Binding RelativeSource={RelativeSource Self},
Path=MyBrush}">
...