RESOURCEDICTIONARY

Amresh Kushwaha

Total Post:38

Points:266
Posted by  Amresh Kushwaha
WPF 
WPF
 8287  View(s)
Ratings:
Rate this:
How to use ResourceDictionary of WPF,,When we use simple windows form and add only usercontrols of wpf
  1. John Smith

    Post:103

    Points:727
    Re: ResourceDictionary

    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")

      Modified On Aug-16-2011 12:48:22 PM
  1. Chris S

    Post:48

    Points:336
    Re: ResourceDictionary


    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

      Modified On Mar-15-2016 07:27:29 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!