To elaborate a static resource, let's make a simple application in UWP. UWP stands for Universal Windows Platform which has been introduced in Windows 10 application development.
Open Visual Studio and make a Windows 10 Universal app as in the following screenshot:
Open your MainPage.xaml from Solution Explorer and go to the XAML code behind XAML Designer.

Now, we're going to add a button inside the Default GridView. In order to add two buttons use the following code:
Its time to add a static resource for these buttons. Use the following code:
After inserting the code for resource your buttons will look like the following:

There are a few properties and XAML objects (tags) that need explanation.

Now, we're going to add a button inside the Default GridView. In order to add two buttons use the following code:
- <Button Content="Click Me 1" Margin="119,191,0,417" ></Button>
- <Button Content="Click Me 2" Margin="119,267,0,341" ></Button>
- <Page.Resources>
- <Style TargetType="Button">
- <Setter Property="Background" Value="Red"></Setter> <Setter Property="Foreground" Value="White"></Setter>
- </Style>
- </Page.Resources>

There are a few properties and XAML objects (tags) that need explanation.
- Property TargetType asks us the Control type that we're going to design using this resource. In this case we're applying our resource on button. You can also apply it in any control that accept resources.
- In the tag of Setter we are using two properties
1. Property = "Background"
This feature asks us to write the the property that we're going to apply on controls. In our case we're going to apply background color on buttons, so we write background.
2. Value = "Red"
Once you write the property that will be applied to controls you need to mention its value as well. In this case I just mentioned it with "Red" color. - You might notice that the styles that we've set for the buttons is applying to all the button that we're using on current scope of project. If you want to apply resources on specific controls you can use Controls with their names.
- If you have any problem just put your comments below the post. I'll respond to you there.

Debasis SahaPosted Mar 24, 2016, 7:11 AM
Nice One..
Mobeen SarwarPosted Feb 12, 2016, 6:08 AM
God job
Shubham KumarPosted Feb 1, 2016, 2:06 AM
nice one
Sibeesh VenuPosted Feb 1, 2016, 1:13 AM
Nice Share
Ankit BansalPosted Feb 1, 2016, 12:40 AM
nice one..
Santhakumar MunuswamyPosted Jan 30, 2016, 2:19 AM
Thanks for nice share