Export (0) Print
Expand All

DockPattern.DockPatternInformation.DockPosition Property

Retrieves the DockPosition of an AutomationElement within a docking container.

Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in uiautomationclient.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public DockPosition DockPosition { get; }
/** @property */
public DockPosition get_DockPosition ()

public function get DockPosition () : DockPosition

Not applicable.

Property Value

The DockPosition of the element, relative to the boundaries of the docking container and other elements within the container.

A docking container is a control that allows the arrangement of child elements, both horizontally and vertically, relative to the boundaries of the docking container and other elements within the container.

The default value is None.

In the following example, a DockPosition value is obtained representing the current dock position for a control that supports DockPattern.

    ///--------------------------------------------------------------------
    /// <summary>
    /// Obtains a DockPattern control pattern from an 
    /// automation element.
    /// </summary>
    /// <param name="targetControl">
    /// The automation element of interest.
    /// </param>
    /// <returns>
    /// A DockPattern object.
    /// </returns>
    ///--------------------------------------------------------------------
    private DockPattern GetDockPattern(
        AutomationElement targetControl)
    {
        DockPattern dockPattern = null;

        try
        {
            dockPattern =
                targetControl.GetCurrentPattern(
                DockPattern.Pattern)
                as DockPattern;
        }
        // Object doesn't support the DockPattern control pattern
        catch (InvalidOperationException)
        {
            return null;
        }

        return dockPattern;
    }

...

    ///--------------------------------------------------------------------
    /// <summary>
    /// Gets the current view identifier from a target.
    /// </summary>
    /// <param name="dockPattern">
    /// The control pattern of interest.
    /// </param>
    /// <returns>
    /// The current dock position.
    /// </returns>
    ///--------------------------------------------------------------------
    private DockPosition GetCurrentDockPosition(
        DockPattern dockPattern)
    {
        if (dockPattern == null)
        {
            throw new ArgumentNullException(
                "DockPattern parameter must not be null.");
        }

        return dockPattern.Current.DockPosition;
    }

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft