Answer the question
In order to leave comments, you need to log in
How to change hover style in Metro UI?
There is a class that inherits Button and adds additional logic to the button according to the tasks of the application. No matter how much I struggled, it seems that the OnPointerEntered event fires before some magical hidden event that overrides the mapping of my colors to the colors from the theme.
Actually, the question is, how can I teach the button to change color from the C # code the way I want, and not globally written in the theme?
Answer the question
In order to leave comments, you need to log in
The question boiled down to: "How can I access a static property from XAML in code."
To do this, in app.xaml a class with a static property is added to the resources:
And in the right place it is accessed, for example like this:
Background="{Binding Instance.Color, Source={StaticResource Foo}}"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question