难以将以下代码转换为XAML:
var b2 = new Binding("Toggled") { RelativeSource = new RelativeSource(RelativeSourceMode.Self) };
button.SetBinding(ButtonBase.CommandParameterProperty, b2);
尝试:
CommandParameter="{Binding Toggled, RelativeSource=Self}"
但这不起作用,"相对来源不支持从字符串转换"
答案 0 :(得分:0)
尝试:
CommandParameter="{Binding Toggled, RelativeSource={RelativeSource Self}}"