c# - Change button style in Universal Windows Platform -


i've tried make simple c# uwp application , don't know how remove gray background when mouse on button.

how that?

(remember: it's uwp windows 10 platform , not windows phone 8.1 or wpf)

the simple button

the button when mouse on

follow these steps:

  1. rightclick in solution explorer , add new item of kind "resourcedictionary"
  2. copy default style of button can find on webpage, need scroll down little bit: msdn

then insert in resourcedictionary.xaml format should this:

<resourcedictionary><style></style></resourcedictionary> 

3. give style key this:

<style x:key="mycustombutton"></style> 

4. go app.xaml edit adding resource dictionary this:

<application.resources>     <resourcedictionary source="resources.xaml"></resourcedictionary> </application.resources> 

the source of resourcedictionary name of resourcedictionary file.

  1. then add style button this: <button style="{staticresource mycustombutton}"></button>
  2. last not least go resourcedictionary , delete following code lines see in screenshot or comment out did: edit style

there more easy solution if use blend visual studio there can edit stuff more keep structure , learning solution above better one.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -