当 a被按下时,我有一个ICommand
触发。Button
发生这种情况时,我需要更改它的背景颜色Button
。如何使用 MVVM 模式做到这一点?
private DelegateCommand asioMuted;
public ICommand AsioMuted
{
get
{
if (asioMuted == null)
{
asioMuted = new DelegateCommand(MuteAsio);
}
return asioMuted;
}
}
XAML:
<Button Content="Mute"
Command="{Binding AsioMuted}"
HorizontalAlignment="Left"
Margin="29,282,0,0"
VerticalAlignment="Top"
Width="42"
RenderTransformOrigin="-0.273,1.818" />