I have a Winforms app that allows the user to drag and drop some labels around the screen.
The objective being to put the matching labels on top of each other.
I keep a reference to these labels in a list, and at the moment i'm checking to see if they're overlapping by doing the following.
foreach (List<Label> labels in LabelsList)
{
var border = labels[1].Bounds;
border.Offset(pnl_content.Location);
if (border.IntersectsWith(labels[0].Bounds))
{
labels[1].ForeColor = Color.Green;
}
else
{
labels[1].ForeColor = Color.Red;
}
}
The problem being that this is only good for Winforms (Bounds.Intersect). What can I do in WPF to achieve the same result?
If it makes a difference, i'm currently adding both labels to different <ItemsControl>
in my view.