Change button style in Universal Windows Platform Change button style in Universal Windows Platform windows windows

Change button style in Universal Windows Platform


Follow these steps:

  1. Rightclick in the Solution Explorer and add a new item of kind "ResourceDictionary"
  2. Copy the Default Style of the Button you can find it on this webpage, you need to scroll down a little bit: Msdn

Then insert it in your ResourceDictionary.xaml format should look like this:

<ResourceDictionary><Style></Style></ResourceDictionary>

3. Give the Style a key like this:

<Style x:Key="MyCustomButton"></Style>

4. Go to App.xaml edit it by adding the Resource Dictionary like this:

<Application.Resources>    <ResourceDictionary Source="Resources.xaml"></ResourceDictionary></Application.Resources>

The Source of the ResourceDictionary is the Name of your ResourceDictionary file.

  1. Then add the style to your button like this: <Button Style="{StaticResource MyCustomButton}"></Button>
  2. Last but not least go back to your ResourceDictionary and delete the following code lines you see in the Screenshot or comment it out like i did:Edit your style

There is a more easy solution if you use Blend for Visual Studio there you can edit this stuff more quickly but to keep the structure and for learning it the solution above is the better one.