Can we calculate the gap bettwen ChildWindow and ParentWidnow?
While I can Drag arround the ChildWindow there is a Distance from the Top and Left.
WHile I try to get the Distance using:
ChildWindow.Margin
it is returning 0,0,0,0
Is there any other method to get the Distance bettwen ChildWindow and ParantWindow?
A child window control actually occupies all the available space on the Silverlight content window. The first element in the template is the overlay
Grid. Its this Grid which dims the “parent” window content and consumes all the mouse events that would otherwise go to “parent” content.Inside the Overlay
Gridis another Grid called “ContentRoot” which contains the border, chrome and your child content. Its thisGridthat gets dragged around and will have a Margin.Using this extension method:-
You could find the ContentRoot with:-
From which you get the margin