Esempio n. 1
0
        static private void UpdateChildrenFrames(XF.Item parent)
        {
            foreach (XF.Item child in parent)
            {
                var view = ViewOfItem(child);
                var lp   = view.LayoutParameters;

                var mlp = lp as ViewGroup.MarginLayoutParams;
                if (mlp != null)
                {
                    mlp.LeftMargin = (int)child.FrameX;
                    mlp.TopMargin  = (int)child.FrameY;
                }
                else
                {
                    throw new NotSupportedException("child does not have margin layout params");
                }

                lp.Width  = (int)child.FrameWidth;
                lp.Height = (int)child.FrameHeight;

                view.LayoutParameters = lp;

                UpdateChildrenFrames(child);
            }
        }
Esempio n. 2
0
        public new void Add(XF.Item child)
        {
            base.Add(child);
#if WINDOWS_UWP
#else
            view.AddSubview((child as Base).view);
#endif
        }
Esempio n. 3
0
 static private View ViewOfItem(XF.Item item)
 {
     if (item is Base)
     {
         return(((Base)item).view);
     }
     if (item is LayoutItem)
     {
         return(((LayoutItem)item).view);
     }
     throw new NotSupportedException("use Item or LayoutItem instead");
 }
Esempio n. 4
0
        public new void InsertAt(int index, XF.Item child)
        {
            base.InsertAt(index, child);
#if __IOS__
            view.InsertSubview((child as Base).view, index);
#elif WINDOWS_UWP
#else
            if (index == 0)
            {
                view.AddSubview((child as Base).view);
            }
            var previousIndex = index - 1;
            var previousView  = view.Subviews[previousIndex];
            view.AddSubview((child as Base).view, AppKit.NSWindowOrderingMode.Above, previousView);
#endif
        }
Esempio n. 5
0
 public new void InsertAt(int index, XF.Item child)
 {
     base.InsertAt(index, child);
     view.AddView(ViewOfItem(child), index);
 }
Esempio n. 6
0
 public new void Add(XF.Item child)
 {
     base.Add(child);
     view.AddView(ViewOfItem(child));
 }
Esempio n. 7
0
 public new void InsertAt(int index, XF.Item child)
 {
     throw new NotSupportedException("use LayoutItem instead");
 }
Esempio n. 8
0
 public new void Add(XF.Item child)
 {
     throw new NotSupportedException("use LayoutItem instead");
 }
Esempio n. 9
0
 public new void InsertAt(int index, XF.Item child)
 {
     base.InsertAt(index, child);
     view.InsertSubview((child as Base).view, index);
 }
Esempio n. 10
0
 public new void Add(XF.Item child)
 {
     base.Add(child);
     view.AddSubview((child as Base).view);
 }