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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:22:52+00:00 2026-05-29T12:22:52+00:00

I am trying to load a Silverlight project to read every XAML file by

  • 0

I am trying to load a Silverlight project to read every XAML file by creating an instance using reflection, Activator.CreateInstance, of every XAML class for reading its controls.

C# Code:

string strPath = "SilverlightUI.dll";
StreamResourceInfo sri = Application.GetResourceStream(new Uri(strPath, UriKind.RelativeOrAbsolute));
AssemblyPart assemblyPart = new AssemblyPart();
Assembly assembly = assemblyPart.Load(sri.Stream);
Type[] typeArray = assembly.GetExportedTypes();

foreach (Type type in typeArray)
{
    object ctl = (object)Activator.CreateInstance(type);
    // Following exception is occurring while creating an instance using above line of code 
    // Exception "Cannot find a Resource with the Name/Key ComboBoxStyle"
}

Perhaps, reflection is not able to recognize Silverlight style ComboBoxStyle. How can i possibly create an instance to read every control in the XAML file dynamically?

  • 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-29T12:22:53+00:00Added an answer on May 29, 2026 at 12:22 pm

    I have managed to find the required solution to my problem after struggling with the Google.

    1. Copy all the Style Resources from Silverlight project (intended to load).
    2. Paste them in the App.xaml of the Master/Caller Silverlight project or application, which is using the reflection code to load the Silverlight Controls information

    Following these steps will eliminate the XAML Parse Exception of missing Style.

    Cannot find a Resource with the Name/Key ComboBoxStyle

    Reference: XAML Parser cannot find resource within dynamically loaded XAP when creating form instance

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

Sidebar

Related Questions

I'm trying to read a XML file from Silverlight. I do it perfectly and
When trying to load Microsoft.Xna.Framework.dll from any project, it throws a FileNotFoundException. The specified
I am am trying to load a SQL table from a flat file. The
I'm trying to load fragments of XHTML markup using jQuery's $.fn.load function, but it
I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method. However, I keep getting
i am trying load file after it created from /stext command line but its
Im trying to load a XML into an object with LinQ in Silverlight with
I'm trying to use Assembly.Load(Byte[]) in a Silverlight 4 app and i'm getting MethodAccessException.
I'm trying to set seletected value to a pre-loaded combobox using silverlight with MVVM.
Greetings Problem When i'm trying to add images to my silverlight project I 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.