通过资源设置控件颜色.
在资源文件中:
<style TargetType="{x:Name button1}">
<setter Property="ColorBrush" Value="Red"/>
</style>
<Window .... >
<Button Name="Button1" Content="Test Button" />
</Window>
Run Code Online (Sandbox Code Playgroud)
喜欢html中的css
<style>
#controlID
{
color:red;
}
</style>
<body>
<input id="button1" type="button" value="test button" />
</body>
Run Code Online (Sandbox Code Playgroud)