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

  • Home
  • SEARCH
  • 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 8039689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:39:13+00:00 2026-06-05T03:39:13+00:00

I am trying to create a metro app based on a Developing windows 8

  • 0

I am trying to create a metro app based on a Developing windows 8 book by Oreilly.

I have the following code, based on the blank metro template

Type rootType = typeof(DependencyObject); 
TypeInfo rootTypeInfo = typeof(DependencyObject).GetTypeInfo(); 
List<Type> classes = new List<Type>(); 
Brush highlightBrush; 

public MainPage()
{
    this.InitializeComponent();
    highlightBrush = this.Resources["ControlHighlightBrush"] as Brush;    

the last line throws this exception. As far as I understand it will search in the common folder the ControlHighlightBrush but if its not present in StandardStyles.xaml file it wont work?

I think thats whats happenning?

An exception of type ‘System.Runtime.InteropServices.COMException’ occurred in mscorlib.dll but was not handled in user code

Additional information: Error HRESULT E_FAIL has been returned from a call to a COM component.

If there is a handler for this exception, the program may be safely continued.

  • 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-06-05T03:39:15+00:00Added an answer on June 5, 2026 at 3:39 am

    I don’t think it looks in any common folder for resources by default. Resources have to be explicitly specified in the App.xaml in MergedDictionary collection:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
    
                <!-- 
                    Styles that define common aspects of the platform look and feel
                    Required by Visual Studio project and item templates
                 -->
                <ResourceDictionary Source="Common/StandardStyles.xaml"/>
                <ResourceDictionary Source="Common/CustomStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
    
            <!-- Application-specific resources -->
    
            <x:String x:Key="AppName">My App</x:String>
        </ResourceDictionary>
    </Application.Resources>
    

    So, you would add your custom styles in some file like CustomStyles.xaml and include it as above.

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

Sidebar

Related Questions

I am trying to create a Windows 8 Metro Application using Grid View with
I'm trying to create my first Metro app, in order to debug it and
I'm trying to create a Win8 Metro reference app for virtualized lists. In doing
I am trying to create a Hello World JS Metro app on Visual Studio
I am developing a metro app using JavaScript and am trying to display two
I'm trying to create some primitive imitation of the Windows Metro style application. What
I've been trying to create a Metro based client for a WCF service, using
Trying to create a PhoneGap app using the canvas tag on an iPad. The
Trying to create COM -object on server. code is: var myGuid = new Guid(530A1815-820C-11D3-BBB7-008048DE406A);
hi I'm trying create chat using node.js I see example in http://chat.nodejs.org/ I have

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.