AutomationProperties.GetFlowsFrom(DependencyObject) メソッド

定義

指定したオートメーション要素の前に読み取り順序を提案するオートメーション要素の一覧を取得します。

public:
 static IVector<DependencyObject ^> ^ GetFlowsFrom(DependencyObject ^ element);
 static IVector<DependencyObject> GetFlowsFrom(DependencyObject const& element);
public static IList<DependencyObject> GetFlowsFrom(DependencyObject element);
function getFlowsFrom(element)
Public Shared Function GetFlowsFrom (element As DependencyObject) As IList(Of DependencyObject)

パラメーター

element
DependencyObject

前の読み取り順序要素を取得する要素。

戻り値

要素パラメーターで指定されたオートメーション要素の前に読み取り順序を示すオートメーション要素の一覧。

Windows の要件

デバイス ファミリ
Windows 10 Anniversary Edition (10.0.14393.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v3.0 で導入)

<StackPanel>
    <Button x:Name="first">First</Button>
    <Button x:Name="third">Third</Button>
    <Button x:Name="second">Second</Button>
    <Button x:Name="fourth">Fourth</Button>
</StackPanel>
public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();

        // Override the default flow for next/previous items in 
        // UI Automation to differ from the sequence of items 
        // declared in markup
        FlowBetween(first, second);
        FlowBetween(second, third);
        FlowBetween(third, fourth);
    }

    public void FlowBetween(UIElement fromElement, UIElement toElement)
    {
        // Set up the flow as bi-directional so that moving next/previous is
        // consistent.
        var flowsToList = AutomationProperties.GetFlowsTo(fromElement);
        var flowsFromList = AutomationProperties.GetFlowsFrom(toElement);

        flowsToList.Add(toElement);
        flowsFromList.Add(fromElement);
    }
}

注釈

リストを取得し、 Add メソッドを呼び出して新しい要素を追加します。

重要

フローを変更するときは、ユーザーがキーボードのみを使用している場合にエスケープできないナビゲーション ループでスタックする状況を作成しないように注意してください。

適用対象