static void TestLogicalTreeInTargetExtensions(SearchTestControl ctrl, Button button1, ListView listView) { var b = ctrl.LogicalTree().ByBinding("Button1Command").Single(); Assert.AreEqual(button1, b); Assert.AreEqual(0, listView.LogicalTree().ByType<ListViewItem>().Count()); }