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. Referencing Resources

Referencing Resources

Scheduled Pinned Locked Moved WPF
wpfhelpquestionannouncementlearning
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.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I want to reuse some styles, so I created a resources file in the root of my project called AppResources.xaml. I then copied the styles into it. At the top of my view, I replaced the styles with

    Yet I get a compile error "An error occured while finding the resource dictionary 'pack://application:,,,/Common;component/AppResources.xaml'". What's the right way to do this? [UPDATE] Fixed it with

    If it's not broken, fix it until it is

    M 1 Reply Last reply
    0
    • K Kevin Marois

      I want to reuse some styles, so I created a resources file in the root of my project called AppResources.xaml. I then copied the styles into it. At the top of my view, I replaced the styles with

      Yet I get a compile error "An error occured while finding the resource dictionary 'pack://application:,,,/Common;component/AppResources.xaml'". What's the right way to do this? [UPDATE] Fixed it with

      If it's not broken, fix it until it is

      M Offline
      M Offline
      Madhan Mohan Reddy P
      wrote on last edited by
      #2

      If you want to access a resource which is in different assembly, then use the pack URI as follows... Pack://application:,,,/SampleAssembly;component/SampleFolder1/SampleImage.jpg If you want to merge two resource dictionaries use the following code suppose if Dictionary1 and Dictionary2 are your resource xaml files, then to merge these resources

      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