Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 905049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:09:05+00:00 2026-05-15T16:09:05+00:00

Can we calculate the gap bettwen ChildWindow and ParentWidnow? While I can Drag arround

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:09:05+00:00Added an answer on May 15, 2026 at 4:09 pm

    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 Grid is another Grid called “ContentRoot” which contains the border, chrome and your child content. Its this Grid that gets dragged around and will have a Margin.

    Using this extension method:-

    public static class VisualTreeEnumeration  
    {  
       public static IEnumerable<DependencyObject> Descendents(this DependencyObject root)  
       {  
         int count = VisualTreeHelper.GetChildrenCount(root);  
         for (int i=0; i < count; i++)  
         {  
           var child = VisualTreeHelper.GetChild(root, i);  
           yield return child;  
           foreach (var descendent in Descendents(child))  
             yield return descendent;  
         }  
       }  
    }
    

    You could find the ContentRoot with:-

    Grid contentRoot = myChildWindow.Descendents().OfType<Grid>().Where(g => g.Name == "ContentRoot");
    

    From which you get the margin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I calculate a point (X,Y) a specified distance away, on a rotated
I need a small program that can calculate the checksum from a user input.
I have to programming a triangle-calculator, that can calculate from three given values all
Is there a way I can calculate a SHA256 hash in Python 2.4? (I
IS there a way that we can calculate how many 'mongod' instances are running
Is there any PHP/GD function that can calculate this: Input: image width, image height
Is there any tool available by which one can calculate the size or a
I want to calculate the top-right position of div , i can calculate it,
I am trying to write a program which can calculate factorial from 1-9 by
Given n threads, is there a way that I can calculate the amount of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.