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 6805155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:33:09+00:00 2026-05-26T19:33:09+00:00

Still learning this stuff on WPF, themes, derivations, etc. I understand basics on the

  • 0

Still learning this stuff on WPF, themes, derivations, etc.

I understand basics on the “Themes\Generic.xaml”, and then setting your application’s app.xaml file to include the resource dictionary pointing to the theme in question.

So, thats fine from an application project perspective. Now, how about from a class library/dll file. I have a DLL project which I want to use as the basis of all controls in my project. In that, I have the Themes/Generic.xaml and have it coded up with some basics to confirm visual design implementation (originally confirmed ok, when tested under an App/exe project).

Now, I want this theme at a level BEFORE the actual application. Again, this is the baseline. Now, I add a second library of custom grouped controls (for example, a user control for address information… multiple address lines, city, state, zip, labels, etc). I want this second library to reference the first library with the themes, so I can see visually at design time what it will look like (alignments, colors, fonts, etc).

What / where should I be looking to let one DLL know about the merge dictionaries that are the basis in the first DLL. Hope this makes sense.

— EDIT — for clarification

First Class Library… “MyThemeLibrary” compiles into a .dll
In this dll is path/file of “/Themes/MyTheme.xaml”

As suggested by first answer, if I have a Resource Dictionary in the first library, I can reference it in anything else that I will derive from it. So, I have

<ResourceDictionary x:Name="MyGenericTheme"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Themes/MyTheme.xaml"/>
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

Second Class Library… “SecondLevel” compiles into a .dll
In this, I have a user control that I want to put a grid for columns/rows, labels and textbox controls into. I want the controls to respect the colors, fonts, sizes, alignments as defined in the “MyTheme.xaml” of the first dll.

<UserControl x:Class="SecondLevel.multipleControlContainer"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

   <Grid>
      <Grid.ColumnDefinitions>
         <ColumnDefinition />
         <ColumnDefinition />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
         <RowDefinition />
      </Grid.RowDefinitions>

      <Label Content="Something" 
         Grid.Row="0" Grid.Column="0" />

      <TextBox Text="Testing" Grid.Row="1" Grid.Column="1" />
   </Grid>
</UserControl>

So, how / what should I do the necessary reference, declaration, inclusion of resource dictionary from the first library into the second.

  • 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. Editorial Team
    Editorial Team
    2026-05-26T19:33:10+00:00Added an answer on May 26, 2026 at 7:33 pm

    make a reference to your dll and if you know where your theme is located you can do this one

    <Application x:Class="My.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <Application.Resources>
        <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
            <!-- Common base theme -->
            <ResourceDictionary Source="pack://application:,,,/Your.Base.Dll;component/YourResDictionary/YourTheme.xaml" />
    
            <!-- here comes your custom theme -->
    
          </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
      </Application.Resources>
    </Application>
    

    do this in the App.xaml

    EDIT after clarification (look at the comments)

    <UserControl x:Class="SecondLevel.multipleControlContainer"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
      <UserControl.Resources>
        <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
            <!-- Common base theme -->
            <ResourceDictionary Source="pack://application:,,,/Your.Base.Dll;component/YourResDictionaryFolder/MyGenericTheme.xaml" />
            <!-- Custom theme -->
            <ResourceDictionary Source="pack://application:,,,/Another.Dll;component/AnotherResDictionaryFolder/MyCustomTheme.xaml" />
          </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
      </UserControl.Resources>
    
      <Grid>
        <!-- all controls in this usercontrol respect the styles in MyGenericTheme.xaml"
             if you use implicite styles-->
        <Grid.ColumnDefinitions>
          <ColumnDefinition />
          <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition />
        </Grid.RowDefinitions>
        <Label Content="Something"
               Grid.Row="0"
               Grid.Column="0" />
        <TextBox Text="Testing"
                 Grid.Row="1"
                 Grid.Column="1" />
    
        <!-- if you use explicit styles then you must do this -->
    
        <TextBox Style="{StaticResource myTextBoxStyle}"
                 Text="Testing"
                 Grid.Row="1"
                 Grid.Column="1" />
      </Grid>
    </UserControl>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Still learning this jQuery stuff.... I like this ajax page loader; it works for
Hi I am still learning this JSON stuff... I think I found a valid
I'm still learning this stuff, but for the most part, my understanding is that
I'm still learning some of this c# stuff, and I couldn't find an answer
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't
I'm still learning ASP.NET and I often see code like this throughout parts of
I'm still learning about REST and, in my test, came up with this scenario
This is going to sound like a silly question, but I'm still learning C,
I'm learning C++ and I'm still confused about this. What are the implications of
I'm still learning the WPF ropes, so if the following question is trivial or

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.