MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.23k stars 2.45k forks source link

PasswordBox Corner Radius #3582

Closed ghost closed 4 years ago

ghost commented 4 years ago

I've successfully set the corner radius on textboxes, but I'm struggling to do the same on a password box. It just doesn't have any effect.

Here is part of my app.xaml

The background change works, but not the border.

Any help appreciated, thanks!

`

`
timunie commented 4 years ago

@Jacquers I had a look in the template and it is a bug there. There is nothing you can do right now (if you do not want to reimplement the style.) I think we will have a fix for this issue soon.

Happy coding Tim

ghost commented 4 years ago

Thanks, much appreciated.

In the mean time I've found a workaround using this: https://codereview.stackexchange.com/questions/197042/rounded-borders-for-different-controls-button-textbox-combobox-via-attached

But had to change some code:

// setting borders for non-combobox controls Border border = control.Template.FindName("border", control) as Border;

to

// setting borders for non-combobox controls Border border = control.Template.FindName("Base", control) as Border;

amkuchta commented 4 years ago

@timunie @punker76 it might be work looking at all of the controls to see where CornerRadius can be implemented. For example, DataGrid, CheckBox, Expander (<= requires some magic depending on whether IsExpanded is true or false) etc. I've been rolling my own templates to handle rounded corners, but making this more easily available would definitely be nice.