public BorderedGraphics(GraphicsElement ge) { selectors = new Hashtable(); ge.ParentGraphics = this; child = ge; initGraphics(); }
public void Add(string name, GraphicsElement g) { if (!variableMap.ContainsKey(name)) { var borderedGraphics = new Border { Padding = new System.Windows.Thickness(1.0), SnapsToDevicePixels = false, Child = g, BorderThickness = new System.Windows.Thickness(0.5), BorderBrush = System.Windows.Media.Brushes.Gray }; variableMap.Add(name, borderedGraphics); panel.Children.Add(borderedGraphics); //System.Windows.Media.RotateTransform rotation =new System.Windows.Media.RotateTransform(90.0); //panel.Children.Add(new Separator() { RenderTransform = rotation, Height = panel.Height }); } }
public static TreeNodeGraphics CreateTree(GraphicsElement root, Core.Types.TreeBase tree) { TreeNodeGraphics tg = new TreeNodeGraphics(tree); tg.ParentGraphics = root; if (tree.GetChildrenAsTreeBase().Count() > 0) { foreach (TreeBase child in tree.GetChildrenAsTreeBase()) { if (child != null) tg.Add(CreateTree(tg, child)); } } return tg; }
private void InitGraphics(string labelText, GraphicsElement graphics) { this.labelText = labelText; grid = new Grid(); label = new Label(); label.Content = labelText; this.graphics = graphics; grid.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; grid.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; grid.RowDefinitions.Add(new RowDefinition()); labelColumn = new ColumnDefinition(); //labelColumn.Width = new System.Windows.GridLength(120); grid.ColumnDefinitions.Add(labelColumn); grid.ColumnDefinitions.Add(new ColumnDefinition()); grid.Children.Add(label); grid.Children.Add(graphics); Grid.SetColumn(label, 0); Grid.SetColumn(graphics, 1); Grid.SetRow(label, 0); Grid.SetRow(graphics, 0); Content = grid; }
public LabeledGraphics(string labelText, GraphicsElement graphics) { InitGraphics(labelText, graphics); }