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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:50:30+00:00 2026-05-31T16:50:30+00:00

I want to modify the default control templates for my project. For my first

  • 0

I want to modify the default control templates for my project. For my first change, I just want to establish a part name for the listview’s ScrollViewer in each theme.

Here is my structure:
MyControlLibrary: defines a couple controls and defines the themes for the standard wpf controls.
MyApplication: uses the control library and included themes.

Here is what I have figured out so far.
Download the default themes from: http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=wpfsamples&DownloadId=7812

Added the downloaded themes to the Themes folder in MyControlLibrary, added necessary references, and modified xmlns:theme namespace to reference the assembly.

From here, I haven’t figured out what to do next. If just overriding the template, that is not too hard, but I want the application to still be theme aware.

Thanks in advance

EDIT:
Okay, I found the solution for this. I hope this helps someone else.

Update your App.xaml

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="{ThemeDictionary AssemblyName=AssemblyWithThemes}"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    <!-- other styles go here -->
</Application.Resources>

where AssemblyWithThemes is the name of the assembly that contains the Themes\ folder with the theme files. I believe the assembly needs to be referenced from your application as well.

Very important, if including additional resources directly in the App.xaml file, place them where the comment is above, otherwise the containing ResourceDictionary becomes another resource instead of setting the Application.Resources property.

Then, all additional styles need to specify the BasedOn attribute to preserve the theme changes. For dynamically created windows, I used new Style(Type) and it prevented the overridden theme from being used. After changing to new Style(Type, Style), it worked perfectly.

  • 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-31T16:50:31+00:00Added an answer on May 31, 2026 at 4:50 pm

    Okay, I found the solution for this. I hope this helps someone else.

    Update your App.xaml

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="{ThemeDictionary AssemblyName=AssemblyWithThemes}"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
        <!-- other styles go here -->
    </Application.Resources>
    

    where AssemblyWithThemes is the name of the assembly that contains the Themes\ folder with the theme files. I believe the assembly needs to be referenced from your application as well.

    Very important, if including additional resources directly in the App.xaml file, place them where the comment is above, otherwise the containing ResourceDictionary becomes another resource instead of setting the Application.Resources property.

    Then, all additional styles need to specify the BasedOn attribute to preserve the theme changes. For dynamically created windows, I used new Style(Type) and it prevented the overridden theme from being used. After changing to new Style(Type, Style), it worked perfectly.

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

Sidebar

Related Questions

I want to modify / change the way the floatformat works. By default it
I want to modify the Flex 3 TextInput control to accept a tab character
If you want to modify the default behaviour of a View Controller by changing
I have a project in SourceForge: Kryptostr , and I want to modify the
I'm trying to slightly modify the default WordPress tag cloud widget. I don't want
I want to modify the solution for highlighting trailing whitespace described here by NOT
I want to modify some code in the Eclipse JDT itself (In the Debug
I want to modify a connection string that's hard-coded in a Java application (jar
I want to modify a view from Action Helper in Zend Framework in preDispatch()
I want to modify my table view cell apparence when the delete button came

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.