Share via


AutomationProperties.GetFlowsTo(DependencyObject) Metodo

Definizione

Ottiene un elenco di elementi di automazione che suggeriscono l'ordine di lettura dopo l'elemento di automazione specificato.

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)

Parametri

element
DependencyObject

Elemento per il quale ottenere gli elementi dell'ordine di lettura seguenti.

Restituisce

Elenco di elementi di automazione che suggeriscono l'ordine di lettura dopo l'elemento di automazione specificato dal parametro dell'elemento .

Esempio

<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);
    }
}

Commenti

Ottenere l'elenco, quindi chiamare il metodo Add per aggiungere un nuovo elemento.

[! Importante] > Quando si modifica il flusso, prestare attenzione a non creare una situazione in cui l'utente si blocca in un ciclo di navigazione che non può eseguire l'escape se usa solo una tastiera.

Si applica a