protected override bool IsContentElementCore() { AutomationPeer wrapperPeer = this.GetWrapperPeer(); if (wrapperPeer != null) { return(wrapperPeer.IsContentElement()); } return(true); }
public void AllTests() { AutomationPeer peer = FrameworkElementAutomationPeer.CreatePeerForElement(CreateConcreteFrameworkElement()); // ContentTest Assert.IsNull(peer.GetChildren(), "#0"); // IsContentElement Assert.IsFalse(peer.IsContentElement(), "IsContentElement"); // GetClassName Assert.AreEqual("DataGridDetailsPresenter", peer.GetClassName(), "GetClassNameCore"); }
public void AllTests() { AutomationPeer peer = FrameworkElementAutomationPeer.CreatePeerForElement(CreateConcreteFrameworkElement()); // GetClassName Assert.AreEqual("DataGridRowsPresenter", peer.GetClassName(), "GetClassNameCore"); // IsContent Assert.IsFalse(peer.IsContentElement(), "IsContentElement"); // GetChildren and Content List <AutomationPeer> children = peer.GetChildren(); Assert.IsNotNull(children, "#0"); Assert.AreEqual(0, children.Count, "#1"); }
public void AllTests() { DataGridColumnHeader fe = CreateConcreteFrameworkElement() as DataGridColumnHeader; AutomationPeer peer = FrameworkElementAutomationPeer.CreatePeerForElement(fe); // GetAutomationControlType Assert.AreEqual(AutomationControlType.HeaderItem, peer.GetAutomationControlType(), "GetAutomationControlType"); // GetBoundingRectangle Rect boundingRectangle = peer.GetBoundingRectangle(); Assert.AreNotEqual(0, boundingRectangle.X, "GetBoundingRectangle X"); Assert.AreNotEqual(0, boundingRectangle.Y, "GetBoundingRectangle Y"); Assert.AreNotEqual(0, boundingRectangle.Width, "GetBoundingRectangle Width"); Assert.AreNotEqual(0, boundingRectangle.Height, "GetBoundingRectangle Height"); // GetChildren List <AutomationPeer> children = peer.GetChildren(); Assert.IsNotNull(children, "#0"); Assert.AreEqual(1, children.Count, "#1"); // IsKeyboardFocusable Assert.IsFalse(peer.IsKeyboardFocusable(), "IsKeyboardFocusable"); // GetClassName Assert.AreEqual("DataGridColumnHeader", peer.GetClassName(), "#0"); // IsContentElement Assert.IsFalse(peer.IsContentElement(), "#0"); // GetName Assert.AreEqual(fe.Content, peer.GetName(), "GetName"); // GetClickablePoint Point p = peer.GetClickablePoint(); Assert.IsFalse(double.IsNaN(p.X), "#0"); Assert.IsFalse(double.IsNaN(p.Y), "#1"); // GetParent Assert.IsNotNull(peer.GetParent(), "GetParent"); // IsOffscreen Assert.IsFalse(peer.IsOffscreen(), "IsOffScreen"); }