In the project, we need a button with a border. Generally, we use a custom templet to do this. In fact, if there is no special need for other functions, we can implement this point more simply.
<ButtonContent= "Borderless button"Style="{Staticresource {X: static toolbar. buttonstylekey }}" />
Someone will use borderbrush = "{X: NULL}" background = "{X: NULL}" to make the button look like there is no border. The problem is: 1. at this time, the borderless effect is related to the topic. If there is no border in the window classic topic, but there will still be a border shadow area under the windowxp topic. 2. Further, even if you only click the button under the window classic topic, the shadow border with the concave effect will still be generated.
Most of the time, you can simply use the built-in toolbar. buttonstylekey to achieve the desired effect. As for more complex display requirements, WPF's powerful and flexible templet is a good solution.