//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;
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public Expander()
 {
     ExpanderLayout = new StackLayout {
         Spacing = Spacing
     };
     ForceUpdateSizeCommand = new Command(ForceUpdateSize);
     InternalChildren.Add(ExpanderLayout);
 }
예제 #6
0
        /// <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;
		}
예제 #9
0
        private void RenderTiles()
        {
            InternalChildren.Clear();

            foreach (var tile in tiles)
            {
                InternalChildren.Add(tile.Image);
            }
        }
예제 #10
0
        public MapBase()
        {
            SetParentMap();

            TileLayers = new TileLayerCollection();
            InternalChildren.Add(tileContainer);
            Initialize();

            Loaded += OnLoaded;
        }
예제 #11
0
        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);
        }
예제 #12
0
        public MergedHeadersPanel()
        {
            _fixedSubPanel = new MergedHeadersSubPanel(true);
            InternalChildren.Add(_fixedSubPanel);

            _scrollingSubPanel  = new MergedHeadersSubPanel(false);
            _scrollingDecorator = new ScrollingMergedHeaderCellDecorator {
                Child = _scrollingSubPanel
            };
            InternalChildren.Add(_scrollingDecorator);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        internal void AddAxis(Axis ax)
        {
            Axis axis = ax;

            _axes.Add(axis);
            if (_startDataIdx >= 0)
            {
                InternalChildren.Insert(_startDataIdx++, axis);
            }
            else
            {
                InternalChildren.Add(axis);
            }
        }
예제 #16
0
        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;
            }
        }
예제 #17
0
        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);
            }
        }
예제 #18
0
        /// <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;
        }
예제 #19
0
        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();
        }
예제 #20
0
        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();
        }
예제 #21
0
        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);
 }
예제 #23
0
        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);
                }
            }
        }