Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button控件后台设置Backgroud背景色无效 #34

Closed
Uhifon opened this issue Nov 22, 2019 · 1 comment
Closed

Button控件后台设置Backgroud背景色无效 #34

Uhifon opened this issue Nov 22, 2019 · 1 comment

Comments

@Uhifon
Copy link

Uhifon commented Nov 22, 2019

前台:
<Button x:Name="button1" Click="button1_Click" Background="Black" Content="Button" Width="150" Height="70“/>

后台:
private void button1_Click(object sender, RoutedEventArgs e)
{
this.button1.Background = new SolidColorBrush(Colors.Red);
}

现象:不能在按钮的click事件中修改此按钮的颜色(鼠标点击时颜色变化为Red了,但是移开后颜色会恢复为Black),其中ButtonStyle的 Link和Outline模式可以修改,Standard和Hollow模式修改失败!另外,可以在事件中修改其他按钮的颜色。
原因分析:应该是鼠标移开的事件导致颜色恢复为以前状态了。

还有一个现象,Link模式的CornerRadius设置无效,其余三种模式OK。

@Mochengvia
Copy link
Owner

目前的版本中不能在悬浮状态下更改按钮的颜色。
此问题已在2.0版本中修复,预计将于下月发布beta版。建议您稍作等待。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants