private void Sv_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if (e.OriginalSource is DependencyObject os) { var parent = LogicalTreeHelper.GetParent(os); while (parent != null && !(parent is IMCustomControls.SelectableTextBlock)) { parent = LogicalTreeHelper.GetParent(parent); } _targetSTB = parent as IMCustomControls.SelectableTextBlock; } }
private void ccTB_DoCopyAction(IMCustomControls.SelectableTextBlock sender) { //List<string> list = new List<string>(); StringBuilder sb = new StringBuilder(); foreach (Inline item in sender.Inlines) { //if (sender.Selection.Contains(item.ContentStart) && sender.Selection.Contains(item.ContentEnd)) { if (item is Run run) { //list.Add(run.Text); sb.Append(run.Text); } else if (item is InlineUIContainer uic && uic.Child is Image chatIMG) { //list.Add(string.Format("{0}{1}{0}", AppData.FlagEmoje, chatIMG.Uid)); sb.Append(chatIMG.Uid); }