问题描述
如何通过在单击事件上使用 Xceed ColorPicker 来更改按钮背景颜色 Button
解决方法
Xml 代码
<xceed:ColorPicker x:Name="MyNiceColorPicker"/>
<Button x:Name="MyNiceButton" Click="MyNiceButton_Click"/>
和 C#
private void MyNiceButton_Click(object sender,RoutedEventArgs e)
{
MyNiceButton.Background = new SolidColorBrush(MyNiceColorPicker.SelectedColor ?? (MyNiceButton.Background as SolidColorBrush).Color);
}