Skip to content

Commit

Permalink
TeachingTip: update beak placement and remove top highlight (#4846)
Browse files Browse the repository at this point in the history
  • Loading branch information
beervoley authored Apr 21, 2021
1 parent 7620b69 commit 3b6deb2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 249 deletions.
15 changes: 4 additions & 11 deletions dev/TeachingTip/APITests/TeachingTipTests.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ public void TeachingTipBackgroundTest()

{
var popup = TeachingTipTestHooks.GetPopup(teachingTip);
var child = popup.Child;
var grandChild = VisualTreeHelper.GetChild(child, 0);
Verify.AreSame(blueBrush, ((Grid)grandChild).Background, "Checking TeachingTip.Background TemplateBinding works");
var rootGrid = popup.Child;
var tailOcclusionGrid = VisualTreeHelper.GetChild(rootGrid, 0);
var contentRootGrid = VisualTreeHelper.GetChild(tailOcclusionGrid, 0);
Verify.AreSame(blueBrush, ((Grid)contentRootGrid).Background, "Checking TeachingTip.Background TemplateBinding works");
}

{
Expand All @@ -96,16 +97,12 @@ public void TeachingTipBackgroundTest()

Log.Comment("Checking LightDismiss TeachingTip Background is using resource for first invocation");

Grid tailEdgeBorder = VisualTreeUtils.FindVisualChildByName(child, "TailEdgeBorder") as Grid;
Polygon tailPolygon = VisualTreeUtils.FindVisualChildByName(child, "TailPolygon") as Polygon;
Polygon topTailPolygonHighlight = VisualTreeUtils.FindVisualChildByName(child, "TopTailPolygonHighlight") as Polygon;
Grid contentRootGrid = VisualTreeUtils.FindVisualChildByName(child, "ContentRootGrid") as Grid;
ContentPresenter mainContentPresenter = VisualTreeUtils.FindVisualChildByName(child, "MainContentPresenter") as ContentPresenter;
Border heroContentBorder = VisualTreeUtils.FindVisualChildByName(child, "HeroContentBorder") as Border;

VerifyLightDismissTipBackground(tailEdgeBorder.Background, "TailEdgeBorder");
VerifyLightDismissTipBackground(tailPolygon.Fill, "TailPolygon");
VerifyLightDismissTipBackground(topTailPolygonHighlight.Fill, "TopTailPolygonHighlight");
VerifyLightDismissTipBackground(contentRootGrid.Background, "ContentRootGrid");
VerifyLightDismissTipBackground(mainContentPresenter.Background, "MainContentPresenter");
VerifyLightDismissTipBackground(heroContentBorder.Background, "HeroContentBorder");
Expand Down Expand Up @@ -140,16 +137,12 @@ void VerifyLightDismissTipBackground(Brush brush, string uiPart)
var popup = TeachingTipTestHooks.GetPopup(teachingTip);
var child = popup.Child as Grid;

Grid tailEdgeBorder = VisualTreeUtils.FindVisualChildByName(child, "TailEdgeBorder") as Grid;
Polygon tailPolygon = VisualTreeUtils.FindVisualChildByName(child, "TailPolygon") as Polygon;
Polygon topTailPolygonHighlight = VisualTreeUtils.FindVisualChildByName(child, "TopTailPolygonHighlight") as Polygon;
Grid contentRootGrid = VisualTreeUtils.FindVisualChildByName(child, "ContentRootGrid") as Grid;
ContentPresenter mainContentPresenter = VisualTreeUtils.FindVisualChildByName(child, "MainContentPresenter") as ContentPresenter;
Border heroContentBorder = VisualTreeUtils.FindVisualChildByName(child, "HeroContentBorder") as Border;

VerifyBackgroundChanged(tailEdgeBorder.Background, "TailEdgeBorder");
VerifyBackgroundChanged(tailPolygon.Fill, "TailPolygon");
VerifyBackgroundChanged(topTailPolygonHighlight.Fill, "TopTailPolygonHighlight");
VerifyBackgroundChanged(contentRootGrid.Background, "ContentRootGrid");
VerifyBackgroundChanged(mainContentPresenter.Background, "MainContentPresenter");
VerifyBackgroundChanged(heroContentBorder.Background, "HeroContentBorder");
Expand Down
Loading

0 comments on commit 3b6deb2

Please sign in to comment.