Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeachingTip: update beak placement and remove top highlight #4846

Merged
merged 4 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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