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); } }
public new void Add(XF.Item child) { base.Add(child); #if WINDOWS_UWP #else view.AddSubview((child as Base).view); #endif }
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"); }
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 }
public new void InsertAt(int index, XF.Item child) { base.InsertAt(index, child); view.AddView(ViewOfItem(child), index); }
public new void Add(XF.Item child) { base.Add(child); view.AddView(ViewOfItem(child)); }
public new void InsertAt(int index, XF.Item child) { throw new NotSupportedException("use LayoutItem instead"); }
public new void Add(XF.Item child) { throw new NotSupportedException("use LayoutItem instead"); }
public new void InsertAt(int index, XF.Item child) { base.InsertAt(index, child); view.InsertSubview((child as Base).view, index); }
public new void Add(XF.Item child) { base.Add(child); view.AddSubview((child as Base).view); }