Show / Hide Table of Contents

Class Clipboard

Provides static methods that facilitate transferring data to and from the system clipboard. In Silverlight 5, this access is limited to Unicode text strings.

Inheritance
System.Object
Clipboard
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public static class Clipboard

Methods

| Improve this Doc View Source

ContainsTextAsync()

Queries the clipboard for the presence of data in the UnicodeText format.

Declaration
public static Task<bool> ContainsTextAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

true if the system clipboard contains Unicode text data; otherwise, false.

| Improve this Doc View Source

GetTextAsync()

Retrieves Unicode text data from the system clipboard, if Unicode text data exists.

Declaration
public static Task<string> GetTextAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.String>

If Unicode text data is present on the system clipboard, returns a string that contains the Unicode text data. Otherwise, returns an empty string.

| Improve this Doc View Source

SetTextAsync(String)

Sets Unicode text data to store on the clipboard, for later access with GetTextAsync().

Declaration
public static Task SetTextAsync(string text)
Parameters
Type Name Description
System.String text

A string that contains the Unicode text data to store on the clipboard.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentNullException

text is null.

  • Improve this Doc
  • View Source