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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:34:25+00:00 2026-05-16T18:34:25+00:00

I am trying to build a library of silverlight controls where the client can

  • 0

I am trying to build a library of silverlight controls where the client can choose which control they want to use. The Silverlight Application project will have several user controls. The structure is something like:

Project
-App.xaml
-MainPage.xaml
--Controls (Folder)
------ControlA.xaml
------ContorlB.xaml

How can i reference ControlA or ControlB from my HTML pages? It seems like its only possible to reference xap assemblies so do i need to create a Silverlight application for each usercontrol? Seems like overkill?

If i wanted to use ControlA from the library so i want to be able to do something like:

<object>
    <param name="source" value="ClientBin/Silverlight.xap"/>
    <param name="class" value="ControlA"/>
</object>

I know the above is not valid SL markup but i think you can understand what I’m trying to do?

  • 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-16T18:34:25+00:00Added an answer on May 16, 2026 at 6:34 pm

    You could have a controller XAML file which reads the InitParams.

    Pass the value in HTML to Silverlight:

    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
          <param name="source" value="ClientBin/SilverlightApplication1.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="initparams" value="control=ControlA" />
          ...
    

    And in your Application_Startup event read out your value:

    private void Application_Startup(object sender, StartupEventArgs e)
    {
        var initParams = e.InitParams;
    
        if (initParams.Keys.Contains("control"))
        {
            if (initParams["control"] == "ControlA")
            { 
                // Render control A
                // this.RootVisual = new ControlA();
            } else  if (initParams["control"] == "ControlB")
            { 
                // Render control B
                // this.RootVisual = new ControlB();
            }
        }
    
        // Default page.    
        this.RootVisual = new MainPage();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build mysql-5.0.33 client library with SSL support. For which I
I'm trying to build a library project which will dynamically call some xml data..
I am trying to build an object library which can be registered and used
I'm trying to build up a library of reusable code to use from project
I am trying to build a Library to use in an application. I built
I'm trying to build some .ascx controls into a class library for plugins for
I'm trying to build an Eclipse plugin that depends on a library which has
I am trying to build a software library cvBlobs which is designed to help
I want to build a static library that requires openssl for iPhone. It can't
I am trying to build my own web application and searching a PDF library

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.