AutomationProperties.GetFlowsTo(DependencyObject) 方法

定義

取得自動化專案的清單,這個清單會建議指定之自動化專案之後的讀取順序。

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

參數

element
DependencyObject

要取得下列讀取順序元素的專案。

傳回

自動化專案清單,這個清單會建議 元素 參數所指定的自動化專案之後的讀取順序。

範例

<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 方法以新增專案。

[!重要] > 修改流程時,請小心不要建立使用者卡在流覽迴圈中的情況,如果他們只使用鍵盤,他們就無法逸出。

適用於