protected override void OnPreviewMouseUp(MouseButtonEventArgs e) { base.OnPreviewMouseUp(e); var _td = e.Source as ui_tokenization_line.tok_display; if (_td == null) return; ui_tokenization_line.tok_display other = null; if (udl.tree_pan.Children.Count > 0) other = udl.tree_pan.Children[0] as ui_tokenization_line.tok_display; var td = new ui_tokenization_line.tok_display(_td.text); udl.tree_pan.Children.Add(td); if (other != null) TreeLayoutPanel.SetTreeParent(td, other); }
public ui_dependency_line(ui_tokenization_line utl, int i_row) : base(utl.g, i_row) { var b = new Border { BorderBrush = Brushes.Black, BorderThickness = new Thickness(1), Margin = new Thickness(3), Child = new StackPanel { Orientation = Orientation.Vertical, }, }; Grid.SetRow(b, i_row); Grid.SetColumn(b, 4); Grid.SetColumnSpan(b, 99); g.Children.Add(b); var sp_updn = (StackPanel)b.Child; this.tok_bin = new dip(this) { Height = 50, Background = Brushes.AliceBlue, }; sp_updn.Children.Add(tok_bin); this.tree_pan = new TreeLayoutPanel { MinHeight = 40, Background = Brushes.Gainsboro, }; sp_updn.Children.Add(tree_pan); ui_tokenization_line.tok_display td; double x = 0; foreach (ui_tokenization_line.tok_display _td in utl.sp_toks.Children) { td = new ui_tokenization_line.tok_display(_td.edge); DragItemPanel.SetLeft(td, x); tok_bin.Children.Add(td); td.Measure(util.infinite_size); x += td.DesiredSize.Width + 8; } td = new ui_tokenization_line.tok_display("EC"); DragItemPanel.SetLeft(td, x); tok_bin.Children.Add(td); }