Share via


AutomationProperties.GetFlowsTo(DependencyObject) Método

Definición

Obtiene una lista de elementos de automatización que sugieren el orden de lectura después del elemento de automatización especificado.

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)

Parámetros

element
DependencyObject

Elemento para el que se van a obtener los siguientes elementos de orden de lectura.

Devoluciones

Lista de elementos de automatización que sugieren el orden de lectura después del elemento de automatización especificado por el parámetro element .

Ejemplos

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

Comentarios

Obtenga la lista y, a continuación, llame al método Add para agregar un nuevo elemento.

[! Importante] > Al modificar el flujo, tenga cuidado de no crear una situación en la que el usuario se bloquea en un bucle de navegación que no puede escapar si solo usa un teclado.

Se aplica a