//create footer header items //TODO Merge private void UpdateGroupItems()//создаем контент { //просто создаем контент без всякой там размерности //сначала надо определиться что делать с тем контентом который уже есть Children.Clear(); var informationItems = QueryActualInformationMetaItems.ToList(); var previewGroupData = default(object); var curentPressentor = default(ContentPresenter); foreach (var informationItem in informationItems) { var curentGroupData = informationItem.GetGroupData(); if (previewGroupData == null || !previewGroupData.Equals(curentGroupData)) { curentPressentor = new ContentPresenter { Content = curentGroupData }; var datatemplate = GetContentTemplate(curentGroupData, curentPressentor); curentPressentor.ContentTemplate = datatemplate; InternalChildren.Add(curentPressentor); } informationItem.Visual = curentPressentor; previewGroupData = curentGroupData; } }
void SyncToNavigationStack(IReadOnlyList <IView> newStack) { for (int i = 0; i < newStack.Count; i++) { var element = (Element)newStack[i]; if (InternalChildren.Count < i) { InternalChildren.Add(element); } else if (InternalChildren[i] != element) { int index = InternalChildren.IndexOf(element); if (index >= 0) { InternalChildren.Move(index, i); } else { InternalChildren.Insert(i, element); } } } while (InternalChildren.Count > newStack.Count) { InternalChildren.RemoveAt(InternalChildren.Count - 1); } }
private void OnSliceAdded(IPieSlice slice) { var labelItem = new PieChartLabelItem { Content = slice.Label, ContentTemplate = LabelTemplate }; SetZIndex(labelItem, LabelZindex); _titleItems.Add(slice, labelItem); InternalChildren.Add(labelItem); var valueItem = new PieChartValueItem { Content = slice.DisplayedValue, ContentTemplate = ValueTemplate }; SetZIndex(valueItem, ValueZIndex); _valueItems.Add(slice, valueItem); InternalChildren.Add(valueItem); var sliceItem = new PieChartSliceItem { Slice = slice }; SetZIndex(sliceItem, SliceZIndex); _sliceItems.Add(slice, sliceItem); InternalChildren.Add(sliceItem); }
protected virtual void CreateHyperEdgeControl(HyperEdge hyperEdge) { var hyperEdgeControl = new HyperEdgeControl { HyperEdge = hyperEdge, DataContext = hyperEdge }; if (HyperEdgeControls.TryAdd(hyperEdge, hyperEdgeControl) is false) { HyperEdgeControls[hyperEdge] = hyperEdgeControl; } // var findVertexList = new List<VertexControl>(); // foreach (var v in hyperEdge.Vertices) // { // if (VertexControls.TryGetValue(v, out var vertexControl) is true) // { // if (vertexControl != null) // findVertexList.Add(vertexControl); // } // } // // hyperEdgeControl.Vertices = findVertexList.ToArray(); hyperEdgeControl.Vertices = hyperEdge.Vertices.Select(v => VertexControls[v]).ToArray(); foreach (var vertexControl in hyperEdgeControl.Vertices) { vertexControl.HyperEdges.Add(hyperEdgeControl); } InternalChildren.Add(hyperEdgeControl); }
public Expander() { ExpanderLayout = new StackLayout { Spacing = Spacing }; ForceUpdateSizeCommand = new Command(ForceUpdateSize); InternalChildren.Add(ExpanderLayout); }
/// <summary> /// Creates a new instance of the <see cref="ScrollBox"/> control. /// </summary> public ScrollBox() { _contentBox = new Box(); _contentBox.BackgroundColor = "#00000000"; InternalChildren.Add(_contentBox); }
public void Push(object page, bool animated) { InternalChildren.Add(page); if (FormsContentControl != null) { FormsContentControl.Transition = animated ? TransitionType.Left : TransitionType.Normal; } CurrentPage = page; }
private void PushPage(Page page) { InternalChildren.Add(page); if (InternalChildren.Count == 1) RootPage = page; CurrentPage = page; }
private void RenderTiles() { InternalChildren.Clear(); foreach (var tile in tiles) { InternalChildren.Add(tile.Image); } }
public MapBase() { SetParentMap(); TileLayers = new TileLayerCollection(); InternalChildren.Add(tileContainer); Initialize(); Loaded += OnLoaded; }
public DockPanel Fill(VisualNode child) { if (_fillChild != null) { throw new InvalidOperationException("Only one child can fill remaining space"); } _fillChild = child; InternalChildren.Add(child); return(this); }
public MergedHeadersPanel() { _fixedSubPanel = new MergedHeadersSubPanel(true); InternalChildren.Add(_fixedSubPanel); _scrollingSubPanel = new MergedHeadersSubPanel(false); _scrollingDecorator = new ScrollingMergedHeaderCellDecorator { Child = _scrollingSubPanel }; InternalChildren.Add(_scrollingDecorator); }
internal ChartViewport2D(ChartView view) { _view = view; Children.Add(_intCanvas); _ax = view.AxisX; _ay = view.AxisY; _axes.Add(_ax); _axes.Add(_ay); InternalChildren.Add(_ax); InternalChildren.Add(_ay); }
public DockPanel DockRight(VisualNode child) { if (Children.Count > 0 && Orientation == Orientation.Vertical) { throw new ArgumentException(); } ((IMetadataProvider)child).SetMetadata(DockMetadataKey, Dock.Right); InternalChildren.Add(child); Orientation = Orientation.Horizontal; return(this); }
internal void AddAxis(Axis ax) { Axis axis = ax; _axes.Add(axis); if (_startDataIdx >= 0) { InternalChildren.Insert(_startDataIdx++, axis); } else { InternalChildren.Add(axis); } }
void AddWindow(IWindow window) { _windows.Add(window); if (window is Element windowElement) { windowElement.Parent = this; InternalChildren.Add(windowElement); OnChildAdded(windowElement); } if (window is NavigableElement ne) { ne.NavigationProxy.Inner = NavigationProxy; } }
public void AddTileLayers(int index, IEnumerable <TileLayer> tileLayers) { foreach (var tileLayer in tileLayers) { if (index < InternalChildren.Count) { InternalChildren.Insert(index, tileLayer); } else { InternalChildren.Add(tileLayer); } index++; tileLayer.UpdateTiles(tileZoomLevel, tileGrid); } }
/// <summary> /// Creates a new instance of the <see cref="ComboBox"/> control. /// </summary> public ComboBox() { _currentDisplay = new TextBlock(); _dropdown = new SelectList(); var dropdownArrow = new Icon { FixedWidth = 16, FixedHeight = 16, VerticalAlignment = VerticalAlignment.Center, Image = GameLoop.LoadTexture("Icons/chevron-down") }; _button = new Button(); var sp = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4 }; sp.AddChild(_currentDisplay); sp.AddChild(dropdownArrow); _button.Content = sp; InternalChildren.Add(_button); _button.Click += HandleButtonClick; _dropdown.SelectedIndexChanged += HandleItemChanged; _currentDisplay.Text = "Select..."; _dropdownBox = new Box { MaxHeight = 75, MinHeight = 4, Content = new ScrollBox { Content = _dropdown } }; _button.LostFocus += HandleLostFocus; }
protected virtual void CreateVertexControl(Vertex vertex) { var vertexControl = new VertexControl { Vertex = vertex, DataContext = vertex, RootHyperGraphCanvas = this }; if (VertexControls.TryAdd(vertex, vertexControl) is false) { VertexControls[vertex] = vertexControl; } // Children.Add(vertexControl); InternalChildren.Add(vertexControl); vertexControl.InvalidateMeasure(); }
void Reset() { List <Element> snapshot = InternalChildren.ToList(); InternalChildren.Clear(); foreach (Element element in snapshot) { element.Owned = false; } for (var i = 0; i < _templatedItems.Count; i++) { T page = _templatedItems.GetOrCreateContent(i, _templatedItems.ListProxy[i]); page.Owned = true; SetIndex(page, i); InternalChildren.Add(page); } var currentNeedsUpdate = true; BatchBegin(); if (ItemsSource != null) { object selected = SelectedItem; if (selected == null || !ItemsSource.Cast <object>().Contains(selected)) { SelectedItem = ItemsSource.Cast <object>().FirstOrDefault(); currentNeedsUpdate = false; } } if (currentNeedsUpdate) { UpdateCurrentPage(); } OnPagesChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); BatchCommit(); }
void PushPage(Page page) { InternalChildren.Add(page); CurrentPage = page; }
/// <summary> /// Adds a child to the container. /// </summary> /// <param name="child">The child to add to the container.</param> public void AddChild(Control child) { InternalChildren.Add(child); }
void CreateDataObjects() { if (_startDataIdx >= 0) { int num = InternalChildren.Count - _startDataIdx; for (int j = 0; j < num; j++) { PlotElement sender = InternalChildren[_startDataIdx] as PlotElement; InternalChildren.RemoveAt(_startDataIdx); if (((sender != null) && (sender.DataPoint != null)) && (sender.DataPoint.Series != null)) { sender.DataPoint.Series.FirePlotElementUnloaded(sender, EventArgs.Empty); } } } Shape plotShape = _view.PlotShape; if ((plotShape != null) && !InternalChildren.Contains(plotShape)) { InternalChildren.Insert(0, plotShape); } _startDataIdx = InternalChildren.Count; IView2DRenderer renderer = _view.Renderer as IView2DRenderer; if (renderer != null) { renderer.CoordConverter = this; UIElement[] elementArray = renderer.Generate(); if (_view.Renderer is BaseRenderer br) { br.FireRendered(this, EventArgs.Empty); } if (elementArray == null) { while (Children.Count > 1) { Children.RemoveAt(Children.Count - 1); } } else { int length = elementArray.Length; for (int k = 0; k < length; k++) { var elem = elementArray[k]; if (elem == null || InternalChildren.Contains(elem)) { continue; } if (elem is FrameworkElement fe && fe.Parent is Panel pnl) { pnl.Children.Remove(elem); } InternalChildren.Add(elem); } while (Children.Count > 1) { Children.RemoveAt(Children.Count - 1); } } } int num5 = _view.Layers.Count; for (int i = 0; i < num5; i++) { FrameworkElement element = _view.Layers[i] as FrameworkElement; if (element != null) { Canvas.SetLeft(element, PlotRect.X); Canvas.SetTop(element, PlotRect.Y); element.Width = PlotRect.Width; element.Height = PlotRect.Height; Children.Add(element); } } foreach (UIElement element5 in _view.Children) { if (!Children.Contains(element5)) { Children.Add(element5); } } }