InkCanvas.GetSelectedElements Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Recupera os FrameworkElement objetos selecionados no 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)
Devoluções
Conjunto de FrameworkElement objetos.
Exemplos
O exemplo seguinte duplica a altura e a largura de cada elemento selecionado num 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
Observações
Este método devolve apenas FrameworkElement objetos, não Stroke objetos.
Para recuperar objetos selecionados Stroke , chame o GetSelectedStrokes método.
Se o EditingMode de InkCanvas estiver definido como EditingMode, os utilizadores podem selecionar Stroke objetos e FrameworkElement objetos. Alternativamente, ambos os tipos de objetos podem ser selecionados usando código: basta chamar o Select método.