InkCanvas.GetSelectedElements InkCanvas.GetSelectedElements InkCanvas.GetSelectedElements InkCanvas.GetSelectedElements Method

Definición

Recupera los objetos FrameworkElement que están seleccionados en InkCanvas.Retrieves the FrameworkElement objects that are selected in the InkCanvas.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<System::Windows::UIElement ^> ^ GetSelectedElements();
public System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.UIElement> GetSelectedElements ();
member this.GetSelectedElements : unit -> System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.UIElement>
Public Function GetSelectedElements () As ReadOnlyCollection(Of UIElement)

Devoluciones

Matriz de objetos FrameworkElement.Array of FrameworkElement objects.

Ejemplos

En el ejemplo siguiente se duplica el alto y el ancho de cada elemento seleccionado InkCanvasen.The following example doubles the height and width of each selected element on an InkCanvas.

ScaleTransform scaler = new ScaleTransform(2,2);

ReadOnlyCollection<UIElement> selectedElements = inkCanvas1.GetSelectedElements();

foreach (UIElement element in selectedElements)
{
    element.RenderTransform = scaler;
}
Dim scaler As New ScaleTransform(2, 2)

Dim selectedElements As ReadOnlyCollection(Of UIElement) = inkCanvas1.GetSelectedElements()

Dim element As UIElement
For Each element In selectedElements
    element.RenderTransform = scaler
Next element

Comentarios

Este método solo FrameworkElement devuelve objetos, no Stroke objetos.This method returns only FrameworkElement objects, not Stroke objects.

Para recuperar los Stroke objetos seleccionados, llame GetSelectedStrokes al método.To retrieve selected Stroke objects, call the GetSelectedStrokes method.

Si el EditingMode valor InkCanvas de está establecido EditingModeen, los usuarios Stroke pueden seleccionar FrameworkElement objetos y objetos.If the EditingMode of InkCanvas is set to EditingMode, users can select Stroke objects and FrameworkElement objects. Como alternativa, ambos tipos de objetos se pueden seleccionar mediante código: simplemente llame al Select método.Alternatively, both types of objects can be selected using code: just call the Select method.

Se aplica a

Consulte también: