in src/AccessibilityInsights.SharedUx/Highlighting/WindowHighlighterBase.cs [200:251]
public void AddElementRoundBorder(A11yElement el, string txt = "!")
{
if (el != null)
{
if (!Items.ContainsKey(el))
{
if (this.IsVisible && !el.BoundingRectangle.IsEmpty && this.Dimensions.IntersectsWith(el.BoundingRectangle))
{
var l = (el.BoundingRectangle.Left - Dimensions.Left) / DPI;
var t = (el.BoundingRectangle.Top - Dimensions.Top) / DPI;
var bord = new Border()
{
BorderBrush = Application.Current.Resources["SearchAndIconForegroundBrush"] as SolidColorBrush,
BorderThickness = new Thickness(2),
Background = Application.Current.Resources["SecondaryBGBrush"] as SolidColorBrush,
Width = 28,
Height = 28,
CornerRadius = new CornerRadius(28),
};
TextBlock tb = null;
if (txt != null)
{
tb = new TextBlock()
{
Text = txt,
Tag = el,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Foreground = Application.Current.Resources["PrimaryFGBrush"] as SolidColorBrush,
};
if (TBCallback != null)
{
tb.MouseDown += TBCallback;
}
bord.Child = tb;
}
canvas.Children.Add(bord);
bord.SetValue(Canvas.LeftProperty, GetMidPoint(l, el.BoundingRectangle.Width, bord.Width));
bord.SetValue(Canvas.TopProperty, GetMidPoint(t, el.BoundingRectangle.Height, bord.Height));
bord.SetValue(Canvas.ZIndexProperty, 0);
Items[el] = new GroupHighlighterItem(bord, tb);
}
}
else
{
Items[el].AddRef();
}
}
}