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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:16:19+00:00 2026-06-14T10:16:19+00:00

Why does System.Windows.Clipboard (PresentationCore.dll) is not friendly with the System.Windows.Thickness (PresentationFramework.dll) but friendly with

  • 0

Why does System.Windows.Clipboard(PresentationCore.dll) is not friendly with the
System.Windows.Thickness (PresentationFramework.dll) but friendly with System.Windows.Point (WindowsBase.dll)

using System;
namespace ConsoleApplication5 {
    class Program {
        /*
        * Add references to 
        * WindowsBase.dll (Point)
        * PresentationFramework.dll (Thickness)
        * PresentationCore.dll (Clipboard)
        */

        [STAThread]
        static void Main(string[] args)
        {
            Test myTest = new Test();
            System.Windows.Clipboard.SetData("myformat", myTest);
            // OutOfMemoryException
            Object myPastedTest = System.Windows.Clipboard.GetData("myformat");
        }
    }

    [Serializable]
    class Test
    {
        // COMMENT THE LINES BELLOW PresentationFramework TO WORK OK!
        // PresentationFramework.dll
        //public System.Windows.Thickness MyThickness { get; set; } 
        public System.Windows.Media.Brush MyBrush { get; set; }

        // WindowsBase.dll
        public System.Windows.Point MyPoint { get; set; }

    }
}
  • 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-14T10:16:20+00:00Added an answer on June 14, 2026 at 10:16 am

    The Brush class isn’t serializable and causes the OutOfMemoryException to be thrown (see http://www.grumpydev.com/2009/09/05/system-outofmemoryexception-gotcha-using-clipboard-getdata-in-wpf/). You might be able to serialize the Test class to XAML and put that onto the clipboard instead, see this link for info:

    How can i serialize xaml "Brush"?

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

Sidebar

Related Questions

I read about the Dispatcher class in .NET. But curiously the System.Windows.Threading namespace does
My ViewModel implements IDisposable, but it looks like the the View (System.Windows.Window) does not.
Why does this work: using namespace System; using namespace System::Windows::Forms; ... if( MessageBox::Show(Really do
I'd like to get hold of version 2.0.50727.832 of System.Windows.Forms.dll - does anyone know
System.Environment.OSVersion does not appear to indicate which Edition of Windows 2003 is installed (Standard,
I am using the namespace System.Windows.Forms.DataVisualization.Charting to create a Chart object on a form.
'StringToVisibilityConverter' does not implement interface member 'System.Windows.Data.IValueConverter.Convert(object, System.Type, object, System.Globalization.CultureInfo)' Any idea what's wrong
I can't seem to find System.Windows.Controls.Pivot.dll anywhere in the sdk folders. Does anyone know
What underlying rendering system does the Qt GUI toolkit use on Windows? (I'm assuming
Does Windows have the notion of system-wide shared memory segments and is there a

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.