Button Button1 = new Button(); Button Button2 = new Button(); Button1.Add(Button2); bool result = Button1.Contains(Button2);
VisualElement parent = // Parent element Label myLabel = new Label { Text = "Hello World!", AutomationId = "myLabel" }; parent.Add(myLabel); bool result = parent.Contains(myLabel);This code will return true since the element with the ID "myLabel" is a child of the parent VisualElement. Package library: Xamarin.Forms