Ejemplo n.º 1
0
 void IDockLayoutRenderer.InsertChild(
     int index,
     IElementRenderer childRenderer,
     DockRegion dockRegion)
 {
     this.InsertChild(index, childRenderer, dockRegion);
 }
Ejemplo n.º 2
0
 void IDockLayoutRenderer.ReplaceChild(
     int index,
     IElementRenderer childRenderer,
     DockRegion dockRegion)
 {
     this.ReplaceChild(index, childRenderer, dockRegion);
 }
Ejemplo n.º 3
0
        void IDockLayoutRenderer.AddChild(
            IElementRenderer childRenderer,
            DockRegion dockRegion)
        {
            var child = this.AddChild(childRenderer);

            this.SetAndroidDockRegion(child, dockRegion);
        }
Ejemplo n.º 4
0
        void IDockLayoutRenderer.ReplaceChild(
            int index,
            IElementRenderer childRenderer,
            DockRegion dockRegion)
        {
            var child = this.ReplaceChild(index, childRenderer);

            SetAndroidDockRegion(child, dockRegion);
        }
Ejemplo n.º 5
0
        void IDockLayoutRenderer.InsertChild(
            int index,
            IElementRenderer childRenderer,
            DockRegion dockRegion)
        {
            var child = this.InsertChild(index, childRenderer);

            this.SetAndroidDockRegion(child, dockRegion);
        }
Ejemplo n.º 6
0
        protected virtual void AddChild(
            IElementRenderer childRenderer,
            DockRegion dockRegion)
        {
            var nativeChild = (FrameworkElement)childRenderer.NativeElement;

            NativeDockPanel.SetDock(nativeChild, ToXamlDockRegion(dockRegion));
            this._panel.Children.Add(nativeChild);
        }
Ejemplo n.º 7
0
        protected virtual void ReplaceChild(
            int index,
            IElementRenderer childRenderer,
            DockRegion dockRegion)
        {
            var nativeChild = (FrameworkElement)childRenderer.NativeElement;

            NativeDockPanel.SetDock(nativeChild, ToXamlDockRegion(dockRegion));
            this._panel.Children[index] = nativeChild;
        }
Ejemplo n.º 8
0
        private void SetAndroidDockRegion(
            AndroidView nativeView,
            DockRegion dockRegion)
        {
            if (null == nativeView)
            {
                throw new ArgumentNullException(nameof(nativeView));
            }

            var layoutParameters = (NativeDockLayout.LayoutParams)nativeView.LayoutParameters;

            layoutParameters.DockRegion = dockRegion;
        }
Ejemplo n.º 9
0
        internal CommandBarButtonCollection(
            CommandBar commandBar,
            DockRegion buttonRegion)
        {
            if (null == commandBar)
            {
                throw new ArgumentNullException(nameof(commandBar));
            }

            this._commandBar   = commandBar;
            this._buttons      = new List <CommandBarButton>();
            this._buttonRegion = buttonRegion;
        }
Ejemplo n.º 10
0
            public void Add(
                View child,
                DockRegion position)
            {
                if (null == child)
                {
                    throw new ArgumentNullException(nameof(child));
                }

                DockRegionProperty.SetValue(child, position);

                this.Add(child);
            }
Ejemplo n.º 11
0
            public void Replace(
                int index,
                View child,
                DockRegion position)
            {
                if (null == child)
                {
                    throw new ArgumentNullException(nameof(child));
                }

                DockRegionProperty.SetValue(child, position);

                this.Replace(index, child);
            }
Ejemplo n.º 12
0
        private static NativeDockRegion ToXamlDockRegion(
            DockRegion dockRegion)
        {
            NativeDockRegion xamlDockRegion;

            if (dockRegion == DockRegion.CenterOverlay)
            {
                xamlDockRegion = NativeDockRegion.CenterOverlay;
            }
            else if (dockRegion == DockRegion.Left)
            {
                xamlDockRegion = NativeDockRegion.Left;
            }
            else if (dockRegion == DockRegion.LeftOverlay)
            {
                xamlDockRegion = NativeDockRegion.LeftOverlay;
            }
            else if (dockRegion == DockRegion.Top)
            {
                xamlDockRegion = NativeDockRegion.Top;
            }
            else if (dockRegion == DockRegion.TopOverlay)
            {
                xamlDockRegion = NativeDockRegion.TopOverlay;
            }
            else if (dockRegion == DockRegion.Right)
            {
                xamlDockRegion = NativeDockRegion.Right;
            }
            else if (dockRegion == DockRegion.RightOverlay)
            {
                xamlDockRegion = NativeDockRegion.RightOverlay;
            }
            else if (dockRegion == DockRegion.Bottom)
            {
                xamlDockRegion = NativeDockRegion.Bottom;
            }
            else if (dockRegion == DockRegion.BottomOverlay)
            {
                xamlDockRegion = NativeDockRegion.BottomOverlay;
            }
            else
            {
                throw new NotSupportedException();
            }

            return(xamlDockRegion);
        }
Ejemplo n.º 13
0
        private static LayoutAxis GetLayoutAxis(
            DockRegion dockRegion)
        {
            LayoutAxis axis;

            if (dockRegion == DockRegion.CenterOverlay)
            {
                axis = LayoutAxis.None;
            }
            else if ((dockRegion == DockRegion.Left) || (dockRegion == DockRegion.LeftOverlay) ||
                     (dockRegion == DockRegion.Right) || (dockRegion == DockRegion.RightOverlay))
            {
                axis = LayoutAxis.Horizontal;
            }
            else
            {
                axis = LayoutAxis.Vertical;
            }

            return(axis);
        }
Ejemplo n.º 14
0
 public LayoutParams(
     DockRegion region)
 {
     this.DockRegion = region;
 }
Ejemplo n.º 15
0
 void IDockLayoutRenderer.AddChild(
     IElementRenderer childRenderer,
     DockRegion dockRegion)
 {
     this.AddChild(childRenderer, dockRegion);
 }