Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xctk:RichTextBox DataContext="{StaticResource EditorViewModel}" Grid.Row="1"
- Height="296" HorizontalAlignment="Center" SpellCheck.IsEnabled="True" Margin="6,145,6,0"
- Name="richTextBoxArticleBody" VerticalAlignment="Top" Width="962" Grid.RowSpan="2"
- BorderBrush="Silver" BorderThickness="1" AcceptsTab="True" FontFamily="Arial" FontSize="12"
- Text="{Binding PastedText, UpdateSourceTrigger=PropertyChanged}" />
- private void FormatPastedTextCommandAction()
- {
- string paste = (string)Clipboard.GetData("Text");
- Clipboard.SetText(paste);
- PastedText += paste.ToString();
- Clipboard.Clear();
- }
- private void FormatPastedTextCommandAction()
- {
- string paste = Clipboard.GetText(); // casting is not required if this function is used
- // Clipboard.SetText(paste); // This line is reduntant
- PastedText += paste; // no need to call ToString()
- // Clipboard.Clear(); // You should not clear the Clipboard, as the user may want to paste the data in some other window/application.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement