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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:47:37+00:00 2026-06-08T10:47:37+00:00

I have a C# class library project in my solution, in which I added

  • 0

I have a C# class library project in my solution, in which I added a User Control and pasted the following code from my WPF application.

The xaml looks all fine, but I am getting certain errors on compiling. For eg:

1) System.Windows.DataFormats' does not contain a definition for 'StringFormat'
2) System.Windows.Controls.TextBlock' does not contain a definition for 'Background' and no extension method 'Background' accepting a first argument of type 'System.Windows.Controls.TextBlock' could be found
3) System.Windows.Media.Colors' does not contain a definition for 'LightCoral'
4) System.Windows.Controls.TextBlock' does not contain a definition for 'Background' and no extension method 'Background' accepting a first argument of type 'System.Windows.Controls.TextBlock' could be found (are you missing a using directive or an assembly reference?)

I am not sure why these errors are occuring and these are related to TextBox’s background, Drag Drop, DataFormats etc. The .xaml.cs code is here as well. http://pastebin.com/CY8E8prz

  • 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-08T10:47:40+00:00Added an answer on June 8, 2026 at 10:47 am

    You have to remove the properties referred to by the errors, because Silverlight simply doesn’t have them or they have a different name (WPF and Silverlight aren’t exactly the same, the former has more features than the latter).

    A few examples:

    • To color the background of a TextBlock, you can wrap it in a Border (adjusting positioning/sizing attributes accordingly).
    • LightCoral looks like a color name, you’ll have to look up something similar or use Color.FromArgb()

    In short, copy-pasted code from WPF to Silverlight very rarely works as-is.

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

Sidebar

Related Questions

I have a class, which is part of a code library project that was
I have a class library which I maintain in it's own project/solution. It contains
I have a Class Library project which houses some shared code between other projects
I have added a portable class library to my solution in which has a
I have a Class Library project and MVC project in the one solution. My
I have a class library project which contains some content files configured with the
I am trying to access database from a Class Library Project. I have connection
I have created a class library as a project. Where I have added a
I just added a class library project to my .NET solution. When I built
I have a class library project which uses a namespace (e.g., Cosmos.Creator.Util). I then

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.