Guest User

Untitled

a guest
Feb 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. [ValueConversion(typeof(String), typeof(FlowDocument))]
  2. public class PlurkToDocumentConverter : IValueConverter
  3. {
  4. #region IValueConverter Members
  5.  
  6. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  7. {
  8. Run run = new Run((String)value);
  9. run.FontSize = 12;
  10.  
  11. Paragraph paragraph = new Paragraph(run);
  12. paragraph.Padding = new System.Windows.Thickness(0.0);
  13.  
  14. FlowDocument document = new FlowDocument(paragraph);
  15.  
  16. document.PagePadding = new System.Windows.Thickness(0.0);
  17.  
  18. return document;
  19. }
  20.  
  21. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  22. {
  23. throw new NotImplementedException();
  24. }
  25.  
  26. #endregion
  27. }
Add Comment
Please, Sign In to add comment