public static IEnumerable <T> FindChildren <T>(this Xamarin.Forms.Element elem) where T : Xamarin.Forms.Element { Stack <Xamarin.Forms.IElementController> elems = new Stack <Xamarin.Forms.IElementController>(10); elems.Push(elem); while (elems.Count != 0) { var e = elems.Pop(); foreach (var c in e.LogicalChildren) { if (c is T ret) { yield return(ret); } elems.Push(c); } } }
private void InitializeFullScreenCapability() { Xamarin.Forms.Element view = Element; while (view.Parent != null) { view = view.Parent; if (view is Xamarin.Forms.ScrollView) { (view as Xamarin.Forms.ScrollView).Scrolled += delegate { DisplaySeekbar(false); }; hasScrollView = true; break; } } imageView = new ImageView(_context) { }; imageView.SetImageResource(Resource.Drawable.portrait_mode); var lv = new RelativeLayout.LayoutParams(60, 60); lv.SetMargins(0, 30, 30, 0); lv.AddRule(LayoutRules.AlignParentRight); imageView.LayoutParameters = lv; Control.AddView(imageView); imageView.Click += delegate { if (IsFullScreen) { ExitFullScreen(); } else { FullScreen(hasScrollView); } }; }
public CornerRadiusOutlineProvider(Xamarin.Forms.Element element) { _element = element; }