Friday, December 04, 2009

Five Minute Silverlight 4 Aides-Memoire #4 – Clipboard Access

private void PopButton_Click(object sender, RoutedEventArgs e)
{
    var newPara = new Paragraph();

    newPara.Inlines.Add(new Run { Text = Clipboard.GetText() });

    this.rightRichTextArea.Blocks.Add(newPara);
}

private void PushButton_Click(object sender, RoutedEventArgs e)
{
    Clipboard.SetText(this.leftRichTextArea.Selection.Text);
}

No comments: