---
title: "ResourceDictionary"  
description: "ResourceDictionary"  
author: "Amresh Kushwaha"  
published: 2011-08-16  
updated: 2011-08-16  
canonical: https://www.mindstick.com/forum/288/resourcedictionary  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# ResourceDictionary

How to use ResourceDictionary of [WPF](https://www.mindstick.com/forum/304/wpf),,When we use [simple](https://yourviews.mindstick.com/story/1469/5-simple-ways-to-stay-fit-amp-healthy) windows [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) and [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) only usercontrols of wpf

## Replies

### Reply by Anonymous User

\
In a ResouceDictionary, we can keep our custom styles, DataTemplates, ControlTemplates, even custom definitions for Brush, Color, Background and a lot of other stuff. But, the important thing is that we have to assign a key to each of them since it is a Dictionary. Or perhaps, we can give names to the styles.\
\
**Check this link\**\
[https://msdn.microsoft.com/en-us/library/system.windows.resourcedictionary(v=vs.110).aspx](https://msdn.microsoft.com/en-us/library/system.windows.resourcedictionary(v=vs.110).aspx)\

### Reply by John Smith

Right Click the project in the Resource folder:\
Add->Existing item->Select the Resource file\
\
You can use following line of code to include resource file.\

```
< Window.Resources >        < ResourceDictionary >            < ResourceDictionary.MergedDictionaries >                < ResourceDictionary Source="sample.xaml" / >            < /ResourceDictionary.MergedDictionaries >        < /ResourceDictionary ></Window.Resources >
```

\
By using key value we can access resource.\
Use this function\
this.FindResource("Key value")


---

Original Source: https://www.mindstick.com/forum/288/resourcedictionary

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
