Xamarin NSTextView to HTML

Sometimes you want to use all the power of NSTextView with all formatting style and everything.

var htmlAttr = new NSAttributedStringDocumentAttributes () {
		DocumentType = NSDocumentType.HTML
		};
var range = new NSRange (0, txtNoteView.TextStorage.Length);
var att = txtNoteView.AttributedString;
var error = new NSError ();
var html = txtNoteView.TextStorage.GetData (range, htmlAttr,out error);

The html obj now have the whole string formated as HTML