c# - WinRt: How to add and remove links on RichEditBox? -
c# - WinRt: How to add and remove links on RichEditBox? -
i spent time on questions: how convert selection in richeditbox hyperlink , how remove link again.
the solution simple. there workarounds consider:
public void insertlink(richeditbox control, string url) { //check conditions - else property assignment crashes if (string.isnullorempty(url)) return; if (string.isnullorempty(control.document.selection.text)) return; control.document.selection.link = "\"" + url + "\""; } public void removelink(richeditbox control) { //can set link empty string, if link assigned, //else property assignment crashes if (string.isnullorempty(control.document.selection.link)) return; control.document.selection.link = ""; } c# windows-runtime rtf uwp
Comments
Post a Comment