Hello,
Welcome to Microsoft Q&A!
First of all, based on the code you shared, you need to add the RichEditBox
to the TabViewItem.Content Property first and then you could add the TabViewItem
to the tabView1. Otherwise, the RichEditBox
might not appear.
Get the RichEditBox in tabviewitem.Content
What you need to do is just get the TabViewItem.Content Property and cast the value to a RichEditBox
.
Like this:
private void Button_Click(object sender, RoutedEventArgs e)
{
var items = MyTabView.TabItems;
MUXC.TabViewItem item = items.LastOrDefault() as MUXC.TabViewItem;
// get the RichEditBox
RichEditBox box = item.Content as RichEditBox;
box.Document.SetText(Windows.UI.Text.TextSetOptions.None, "This");
}
This is based on the code you shared in the comment. If you have any other problems, please feel free to contact us.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.