File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Microsoft.Toolkit.Uwp.UI.Controls.Input/RichSuggestBox Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ public void AddTokens(IEnumerable<RichSuggestToken> tokens)
126126 }
127127 }
128128
129+ /// <summary>
130+ /// Populate the <see cref="RichSuggestBox"/> with an existing Rich Text Format (RTF) document and a collection of tokens.
131+ /// </summary>
132+ /// <param name="rtf">The Rich Text Format (RTF) text to be imported.</param>
133+ /// <param name="tokens">The collection of tokens embedded in the document.</param>
134+ public void Load ( string rtf , IEnumerable < RichSuggestToken > tokens )
135+ {
136+ Clear ( ) ;
137+ AddTokens ( tokens ) ;
138+ TextDocument . SetText ( TextSetOptions . FormatRtf , rtf ) ;
139+ }
140+
129141 /// <summary>
130142 /// Try getting the token associated with a text range.
131143 /// </summary>
You can’t perform that action at this time.
0 commit comments