
MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide
By :

Silverlight 4 introduced a new API for working with text via the clipboard. Currently Silverlight's clipboard API is limited only to text, but it is still a great way for your application to interact with not only its host page, but the entire host OS. Working with the clipboard is all about using the new Clipboard
static class. The Clipboard
class exposes three methods for working with text as follows:
ContainsText:
This queries the Clipboard
object to check whether or not it includes any text
GetText:
This retrieves any saved text in the Clipboard
object
SetText:
This sets the text you wish to save in the Clipboard
object
Setting and getting text from the clipboard is as trivial as it gets. To get data from the clipboard, we will use the following line of code:
string textFromClipboard = Clipboard.GetText();
To set the clipboard's text, we will use the following line of code:
Clipboard.SetText("Some sample text.");
When trying to use the Clipboard
class in a...
Change the font size
Change margin width
Change background colour