# C1.WPF.PopupUtil.TestPosition

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_PopupUtil_TestPosition_" data-uid="C1.WPF.PopupUtil.TestPosition*">TestPosition Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_PopupUtil_TestPosition_" data-uid="C1.WPF.PopupUtil.TestPosition*"></a>
<h4 id="C1_WPF_PopupUtil_TestPosition_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Windows_Point_System_Double_System_Double_System_Windows_FlowDirection_" data-uid="C1.WPF.PopupUtil.TestPosition(System.Windows.FrameworkElement,C1.WPF.Anchor,System.Windows.FrameworkElement,C1.WPF.Anchor,System.Windows.Point,System.Double,System.Double,System.Windows.FlowDirection)">TestPosition(FrameworkElement, Anchor, FrameworkElement, Anchor, Point, double, double, FlowDirection)</h4>
<div class="markdown level1 summary"><p>Calculates the position of a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> so that the specified point in the FrameworkElement matches the specified point of another FrameworkElement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Point TestPosition(FrameworkElement positionElement, Anchor positionAnchor, FrameworkElement element, Anchor elementAnchor, Point elementOffset, double overlapHorizontal, double overlapVertical, FlowDirection flowDir)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function TestPosition(positionElement As FrameworkElement, positionAnchor As Anchor, element As FrameworkElement, elementAnchor As Anchor, elementOffset As Point, overlapHorizontal As Double, overlapVertical As Double, flowDir As FlowDirection) As Point</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">positionElement</span></td>
      <td><p>The element to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">positionAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the element to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">element</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> to use as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">elementAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the FrameworkElement used as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><span class="parametername">elementOffset</span></td>
      <td><p>The offset (absolute position) of the reference element.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapHorizontal</span></td>
      <td><p>The horizontal overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapVertical</span></td>
      <td><p>The vertical overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.flowdirection">FlowDirection</a></td>
      <td><span class="parametername">flowDir</span></td>
      <td><p>The FlowDirection used for the calculations.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><p>The absolute point where the FrameworkElement would be located.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_PopupUtil_TestPosition_" data-uid="C1.WPF.PopupUtil.TestPosition*"></a>
<h4 id="C1_WPF_PopupUtil_TestPosition_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Windows_Point_System_Double_System_Double_" data-uid="C1.WPF.PopupUtil.TestPosition(System.Windows.FrameworkElement,C1.WPF.Anchor,System.Windows.FrameworkElement,C1.WPF.Anchor,System.Windows.Point,System.Double,System.Double)">TestPosition(FrameworkElement, Anchor, FrameworkElement, Anchor, Point, double, double)</h4>
<div class="markdown level1 summary"><p>Calculates the position of a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> so that the specified point in the FrameworkElement matches the specified point of another FrameworkElement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Point TestPosition(FrameworkElement positionElement, Anchor positionAnchor, FrameworkElement element, Anchor elementAnchor, Point elementOffset, double overlapHorizontal, double overlapVertical)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function TestPosition(positionElement As FrameworkElement, positionAnchor As Anchor, element As FrameworkElement, elementAnchor As Anchor, elementOffset As Point, overlapHorizontal As Double, overlapVertical As Double) As Point</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">positionElement</span></td>
      <td><p>The element to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">positionAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the element to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">element</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> to use as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">elementAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the FrameworkElement used as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><span class="parametername">elementOffset</span></td>
      <td><p>The offset (absolute position) of the reference element.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapHorizontal</span></td>
      <td><p>The horizontal overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapVertical</span></td>
      <td><p>The vertical overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><p>The absolute point where the FrameworkElement would be located.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_PopupUtil_TestPosition_" data-uid="C1.WPF.PopupUtil.TestPosition*"></a>
<h4 id="C1_WPF_PopupUtil_TestPosition_System_Windows_Controls_Primitives_Popup_C1_WPF_Anchor_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Double_System_Double_" data-uid="C1.WPF.PopupUtil.TestPosition(System.Windows.Controls.Primitives.Popup,C1.WPF.Anchor,System.Windows.FrameworkElement,C1.WPF.Anchor,System.Double,System.Double)">TestPosition(Popup, Anchor, FrameworkElement, Anchor, double, double)</h4>
<div class="markdown level1 summary"><p>Calculates the position of a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.popup">Popup</a> so that the specified point in the Popup matches the specified point of a FrameworkElement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Point TestPosition(Popup popup, Anchor popupAnchor, FrameworkElement element, Anchor elementAnchor, double overlapHorizontal, double overlapVertical)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function TestPosition(popup As Popup, popupAnchor As Anchor, element As FrameworkElement, elementAnchor As Anchor, overlapHorizontal As Double, overlapVertical As Double) As Point</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.popup">Popup</a></td>
      <td><span class="parametername">popup</span></td>
      <td><p>The popup to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">popupAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the Popup.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">element</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> to use as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">elementAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the FrameworkElement.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapHorizontal</span></td>
      <td><p>The horizontal overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapVertical</span></td>
      <td><p>The vertical overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><p>The absolute point where the popup would be located</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_PopupUtil_TestPosition_" data-uid="C1.WPF.PopupUtil.TestPosition*"></a>
<h4 id="C1_WPF_PopupUtil_TestPosition_System_Windows_Controls_Primitives_Popup_C1_WPF_Anchor_System_Windows_FrameworkElement_C1_WPF_Anchor_" data-uid="C1.WPF.PopupUtil.TestPosition(System.Windows.Controls.Primitives.Popup,C1.WPF.Anchor,System.Windows.FrameworkElement,C1.WPF.Anchor)">TestPosition(Popup, Anchor, FrameworkElement, Anchor)</h4>
<div class="markdown level1 summary"><p>Calculates the position of a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.popup">Popup</a> so that the specified point in the Popup matches the specified point of a FrameworkElement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Point TestPosition(Popup popup, Anchor popupAnchor, FrameworkElement element, Anchor elementAnchor)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function TestPosition(popup As Popup, popupAnchor As Anchor, element As FrameworkElement, elementAnchor As Anchor) As Point</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.popup">Popup</a></td>
      <td><span class="parametername">popup</span></td>
      <td><p>The popup to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">popupAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the Popup.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">element</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> to use as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">elementAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the FrameworkElement.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><p>The absolute point where the popup would be located</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_PopupUtil_TestPosition_" data-uid="C1.WPF.PopupUtil.TestPosition*"></a>
<h4 id="C1_WPF_PopupUtil_TestPosition_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Windows_FrameworkElement_C1_WPF_Anchor_System_Double_System_Double_" data-uid="C1.WPF.PopupUtil.TestPosition(System.Windows.FrameworkElement,C1.WPF.Anchor,System.Windows.FrameworkElement,C1.WPF.Anchor,System.Double,System.Double)">TestPosition(FrameworkElement, Anchor, FrameworkElement, Anchor, double, double)</h4>
<div class="markdown level1 summary"><p>Calculates the position of a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> so that the specified point in the FrameworkElement matches the specified point of another FrameworkElement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Point TestPosition(FrameworkElement positionElement, Anchor positionAnchor, FrameworkElement element, Anchor elementAnchor, double overlapHorizontal, double overlapVertical)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function TestPosition(positionElement As FrameworkElement, positionAnchor As Anchor, element As FrameworkElement, elementAnchor As Anchor, overlapHorizontal As Double, overlapVertical As Double) As Point</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">positionElement</span></td>
      <td><p>The element to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">positionAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the element to position.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></td>
      <td><span class="parametername">element</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> to use as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Anchor.html">Anchor</a></td>
      <td><span class="parametername">elementAnchor</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Anchor.html">Anchor</a> value specifying the point in the FrameworkElement used as reference.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapHorizontal</span></td>
      <td><p>The horizontal overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">overlapVertical</span></td>
      <td><p>The vertical overlap between the elements (used for corner matching's).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.point">Point</a></td>
      <td><p>The absolute point where the FrameworkElement would be located.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
