Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <xctk:RichTextBox DataContext="{StaticResource EditorViewModel}" Grid.Row="1"
  2. Height="296" HorizontalAlignment="Center" SpellCheck.IsEnabled="True" Margin="6,145,6,0"
  3. Name="richTextBoxArticleBody" VerticalAlignment="Top" Width="962" Grid.RowSpan="2"
  4. BorderBrush="Silver" BorderThickness="1" AcceptsTab="True" FontFamily="Arial" FontSize="12"
  5. Text="{Binding PastedText, UpdateSourceTrigger=PropertyChanged}" />
  6.  
  7. private void FormatPastedTextCommandAction()
  8. {
  9. string paste = (string)Clipboard.GetData("Text");
  10.  
  11. Clipboard.SetText(paste);
  12.  
  13. PastedText += paste.ToString();
  14.  
  15. Clipboard.Clear();
  16. }
  17.  
  18. private void FormatPastedTextCommandAction()
  19. {
  20. string paste = Clipboard.GetText(); // casting is not required if this function is used
  21.  
  22. // Clipboard.SetText(paste); // This line is reduntant
  23.  
  24. PastedText += paste; // no need to call ToString()
  25.  
  26. // Clipboard.Clear(); // You should not clear the Clipboard, as the user may want to paste the data in some other window/application.
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement