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)
follow these steps:
- rightclick in solution explorer , add new item of kind "resourcedictionary"
- 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.
- then add style button this:
<button style="{staticresource mycustombutton}"></button>
- last not least go resourcedictionary , delete following code lines see in screenshot or comment out did:
there more easy solution if use blend visual studio there can edit stuff more keep structure , learning solution above better one.
Comments
Post a Comment