Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Resource dictionary [modified]

Resource dictionary [modified]

Scheduled Pinned Locked Moved WPF
wpfhelpquestionlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CrafterIt
    wrote on last edited by
    #1

    Hello! i have a problem with the resource dictionaries in silverlight, control styles is using the colors in my colors resource. but when i do this i get runtime error when i load the silverlight app in my browser: Cannot find a Resource with the Name/Key OfficeBlue [Line: 10 Position: 44] i have confirmed that the key name exists in colors.xaml this is from my app.xaml

    <Application.Resources>

    	<ResourceDictionary>
    		<ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Colors.xaml" />
                <ResourceDictionary Source="Navigate/Control styles.xaml"/>   			
    		</ResourceDictionary.MergedDictionaries>
    	</ResourceDictionary>
        
    </Application.Resources>
    

    How do i use colors.xaml resource in my control style? Thanks!

    modified on Tuesday, April 19, 2011 2:25 AM

    K 1 Reply Last reply
    0
    • C CrafterIt

      Hello! i have a problem with the resource dictionaries in silverlight, control styles is using the colors in my colors resource. but when i do this i get runtime error when i load the silverlight app in my browser: Cannot find a Resource with the Name/Key OfficeBlue [Line: 10 Position: 44] i have confirmed that the key name exists in colors.xaml this is from my app.xaml

      <Application.Resources>

      	<ResourceDictionary>
      		<ResourceDictionary.MergedDictionaries>
                  <ResourceDictionary Source="Colors.xaml" />
                  <ResourceDictionary Source="Navigate/Control styles.xaml"/>   			
      		</ResourceDictionary.MergedDictionaries>
      	</ResourceDictionary>
          
      </Application.Resources>
      

      How do i use colors.xaml resource in my control style? Thanks!

      modified on Tuesday, April 19, 2011 2:25 AM

      K Offline
      K Offline
      Kunal Chowdhury IN
      wrote on last edited by
      #2

      It is unable to find the Resource file. Give a proper path there. A typical resource dictionary path will look as below:

      <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="/ASSEMBLY_NAME;component/FILENAME.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>

      Note: Change the name of the ASSEMBLY_NAME in the above code. Also change the FILENAME. If it is in a different sub directory, say "Themes", it will look as below:

      <ResourceDictionary Source="/ASSEMBLY_NAME;component/Themes/FILENAME.xaml"/>

      Hope this will answer your query. Mark as Answer, if this helps.

      Regards - Kunal Chowdhury | Microsoft MVP (Silverlight) | CodeProject MVP | Software Engineer

      New Articles on Silverlight 5 Beta:  Debugging Data Bindings in XAML | Working with Multiple Click (ClickCount)

      Appreciate your Vote and Feedback

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups