请解释为什么这样做不可行。
<ContextMenu>
<MenuItem>
<MenuItem.Header>
<TextBox Name="tbColor" Text="Black" />
</MenuItem.Header>
<MenuItem.Icon>
<TextBox Text="{Binding ElementName=tbColor,Path=Text}" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
I have tried several ways but nothing. RelativeSource
doesn t work..
Edit. binding from another control work.
<DataGrid Foreground="{Binding ElementName=tbColor,Path=Text,Converter={StaticResource textToBrushConverter}}">
<DataGrid.ContextMenu>
<ContextMenu>....