Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 173225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:18:20+00:00 2026-05-11T13:18:20+00:00

In WPF it was possible to organise the XAML for multiple user controls by

  • 0

In WPF it was possible to organise the XAML for multiple user controls by keeping the markup in separate XAML files in the themes folder and then using MergedDictionaries to import them into generic.xaml:

<ResourceDictionary>     <ResourceDictionary.MergedDictionaries>         <ResourceDictionary Source='MyFirstControl.xaml' />         <ResourceDictionary Source='MySecondControl.xaml' />     </ResourceDictionary.MergedDictionaries> </ResourceDictionary> 

With the availability of the Silverlight 3 beta introducing merged dictionary support, it seemed like it might be possible to do the same with Silverlight user controls. But despite trying all combinations of build action on the merged dictionary files and the corresponding syntax for the source reference in generic.xaml, I can’t seem to get it working.

Has anyone else tried? Does anyone know if it is possible and if so what I am doing wrong?


OK – so after numerous test projects, getting working samples in WPF and moving the XAML and C# code over to Silverlight 3 and it still failing, I did a full uninstall and reinstall of ALL the Silverlight 2 bits AND ALL the Silverlight 3 beta bits and finally got things working.

I can only assume that I somehow ended up with a faulty install of the beta – I don’t know but it seemed like I was still running in the Silverlight 2 runtime despite apparently having the version 3 runtime installed.

Thanks Jared for taking a look at things and checking with the SL3 team…and thanks to Amy Dullard and Shawn Wildermuth for producing the instructions and batch files for running Silverlight 2 & 3 on the same machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:18:21+00:00Added an answer on May 11, 2026 at 1:18 pm

    I just tried the following in a user control and it worked:

    <UserControl.Resources>     <ResourceDictionary>         <ResourceDictionary.MergedDictionaries>             <ResourceDictionary Source='ResourcesA.xaml' />             <ResourceDictionary Source='ResourcesB.xaml' />         </ResourceDictionary.MergedDictionaries>     </ResourceDictionary> </UserControl.Resources> <StackPanel>     <Rectangle Width='100' Height='100' Fill='{StaticResource ResAColor}' />     <Rectangle Width='100' Height='100' Fill='{StaticResource ResBColor}' /> </StackPanel> 

    But you specifically mention generic.xaml. What sort of problem are you having?

    — EDIT

    Based on the additional comments, I talked with the SL3 team and got the following answer:

    Works for me, using generic.xaml compiled as a Resource, and using the full resource syntax. There is a bug on not being able to use relative URIs for the Source in generic.xaml (31783) but the non-relative form should work just fine

    <ResourceDictionary Source='/SilverlightClassLibrary1;component/CustomControl.xaml'/> 

    in generic.xaml, and modify the build actions for both generic.xaml and CustomControl.xaml to be Resource. Let me know if there’s still trouble—if you get a repro, I can take a look at it.

    Does that help?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created the simplest possible WPF control - It just overrides OnRender and draws
Is it possible in WPF to bind a ListView (NOT a DataGrid) to a
Is it possible in WPF to embed a ProgressBar in the Background of a
In WPF it's possible to set a property of a custom control by either
Is it possible in WPF to implictly style a control that sits within another
I've done plenty of programming before for CLI and the web, however recently I
I'm not very familiar with C# so far, at least not enough to feel
I'm currently creating an MVC application that will likely to expand to include a
So obviously I am doing something wrong, but I just cannot seem to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.