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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:22:05+00:00 2026-05-11T19:22:05+00:00

I’m considering creating a WPF front end for a Silverlight application. Since Silverlight generally

  • 0

I’m considering creating a WPF front end for a Silverlight application. Since Silverlight generally has the smaller subset of functionality this should be possible, but I’m not sure the best way to approach the problem. From the outset, let me say that I’m currently running the app out of browser but it lacks functionality like capturing system wide keypresses that I’d like to add, along with some W7 integration.

I’ve previously shared source between Silverlight and WPF by creating a project for each, then using “add as link” to link source files between the two. This time around I’ll probably use .NET RIA Services to share source and business logic between the platforms.

The problem I see is sharing Xaml between the projects. It’s pretty much copy and paste compatible, save for the namespaces, but that’s not a great way to share the resources. Has anyone come up with a good way to share the Xaml between Silverlight and WPF?

A final option that crossed my mind was to have the WPF application use a Browser control to host the Silverlight app. Then I can add Windows specific features around that. To me this seems like the cleanest way to go from a development and testing perspective. What does everyone think?

  • 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-11T19:22:06+00:00Added an answer on May 11, 2026 at 7:22 pm

    Here is a trick you could use.

    1. Make sure your Silverlight Views and View Models are isolated within their own assembly that is easily referenceable by your WPF application.
    2. Add a reference to the Silverlight class library that houses the Views & View Models in the WPF application.
    3. Move the contents of the UserControl, “CustomerView” into a DataTemplate housed in a resource dictionary called “customerViewTemplate”

    4. Inside your root UI element XAML files in Silverlight and WPF do this:

    <ContentControl ContentTemplate="{Staticresource customerViewTemplate}" />

    1. In the Silverlight application’s App.xaml make sure to add the following Resource Dictionary reference to the merged dictionaries.

    <ResourceDictionary Source="MyApp.Views;component/CustomerViewResources.xaml" />

    1. In the WPF application’s App.xaml make sure to add the following resource dictionary reference to the merged dictionaries.

    <ResourceDictionary Source="pack://application:,,,/MyApp.Views;component/CustomerViewResources.xaml" />

    Sorry about the numbering, looks like Stack Overflow’s ordered list mechanism is a little off.

    The reason why this works is because you can’t directly reference a Silverlight UserControl from XAML within WPF. It will give you the following error:

    ‘Cannot resolve dependency to assembly
    ‘System.Windows, Version=2.0.5.0,
    Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e’
    because it has not been preloaded.
    When using the ReflectionOnly APIs,
    dependent assemblies must be
    pre-loaded or loaded on demand through
    the ReflectionOnlyAssemblyResolve
    event.

    If you try to force the UserControl onto a WPF Grid using C# you will get the following 3 errors:

    The best overloaded method match for
    ‘System.Windows.Controls.UIElementCollection.Add(System.Windows.UIElement)’ has some invalid arguments.

    The type
    ‘System.Windows.Controls.UserControl’
    is defined in an assembly that is not
    referenced. You must add a reference
    to assembly ‘System.Windows,
    Version=2.0.5.0, Culture=neutral,
    PublicKeyToken=7cec85d7bea7798e’

    cannot convert from
    ‘ToWpfTest.Views.TestView’ to
    ‘System.Windows.UIElement’

    I gather this is because the System.Windows.UIElement in WPF is not the same as the System.Windows.UIElement in Silverlight.

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

Sidebar

Ask A Question

Stats

  • Questions 147k
  • Answers 147k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I am not sure but maybe you can modify the… May 12, 2026 at 9:11 am
  • Editorial Team
    Editorial Team added an answer I think it is possible, but you will probably need… May 12, 2026 at 9:11 am
  • Editorial Team
    Editorial Team added an answer You simply want to use the TransformBlock and TransformFinalBlock members… May 12, 2026 at 9:11 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.