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

TextBox watermark opacity/color override #3868

Closed
Waexu opened this issue Jun 28, 2020 · 3 comments · Fixed by #3950
Closed

TextBox watermark opacity/color override #3868

Waexu opened this issue Jun 28, 2020 · 3 comments · Fixed by #3950
Labels
Milestone

Comments

@Waexu
Copy link

Waexu commented Jun 28, 2020

It would be great to have an ability to override watermark style. I found out that watermark changing it's opacity to 0.2 on focus using storyboard, not style. I didn't find the way to override this storyboard (any suggestions??). I'm my case old people are working with software and they barely can read watermarks despite that I've made it larger.

@timunie
Copy link
Collaborator

timunie commented Jun 29, 2020

Hi @Waexu ,

as far as I can see there is no "easy" way to change the Storyboard, which comes by WPF intern performance reasons. You need to override the entire ControlTemplate.

Here is the original Template / Style: github.com/MahApps/MahApps.Metro/blob/develop/src/MahApps.Metro/Styles/Controls.TextBox.xaml

And here is the original Storyboard:

<Storyboard x:Key="MahApps.Storyboard.EnterGotFocus" po:Freeze="True">

Happy coding
Tim

@Waexu
Copy link
Author

Waexu commented Jun 29, 2020

Hi @Waexu ,

as far as I can see there is no "easy" way to change the Storyboard, which comes by WPF intern performance reasons. You need to override the entire ControlTemplate.

Here is the original Template / Style: github.com/MahApps/MahApps.Metro/blob/develop/src/MahApps.Metro/Styles/Controls.TextBox.xaml

And here is the original Storyboard:

<Storyboard x:Key="MahApps.Storyboard.EnterGotFocus" po:Freeze="True">

Happy coding
Tim

Thank you for a reply!
Do you have any plans for customizing opacity values? I'm asking because I need to decide what to do: override ControlTemplate or just wait. Also I can implement it by myself however I never did commits to open source projects so if there are any special rules - let me know. Thank you

@timunie
Copy link
Collaborator

timunie commented Jun 30, 2020

Hi @Waexu ,
I was not able to get it customized using DynamicResource or Binding, so I think it is tricky to implement customization here (I only found a workaround: https://stackoverflow.com/questions/2186933/wpf-animation-binding-to-the-to-attribute-of-storyboard-animation ).

You are welcome to contribute to MahApps, but I have one point for you. There are Templates for Bugs, Feature Requests and Pull Requests. Next time, please fill them out. see: https://github.com/MahApps/MahApps.Metro/wiki/Contributing

Maybe some might find a solution for it, so you can leave this issue open.

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

Successfully merging a pull request may close this issue.

3 participants