RoutedEventArgs.RoutedEvent RoutedEventArgs.RoutedEvent RoutedEventArgs.RoutedEvent RoutedEventArgs.RoutedEvent Property

Definición

Obtiene o establece el RoutedEvent asociado a esta instancia RoutedEventArgs.Gets or sets the RoutedEvent associated with this RoutedEventArgs instance.

public:
 property System::Windows::RoutedEvent ^ RoutedEvent { System::Windows::RoutedEvent ^ get(); void set(System::Windows::RoutedEvent ^ value); };
public System.Windows.RoutedEvent RoutedEvent { get; set; }
member this.RoutedEvent : System.Windows.RoutedEvent with get, set
Public Property RoutedEvent As RoutedEvent

Valor de propiedad

Identificador del evento que se ha invocado.The identifier for the event that has been invoked.

Excepciones

Intentó cambiar la RoutedEvent valor mientras se estaba enrutando el evento.Attempted to change the RoutedEvent value while the event is being routed.

Ejemplos

El ejemplo siguiente se crea nuevos datos de eventos enrutados con un constructor inicial y, a continuación, Establece el RoutedEvent propiedad como una operación posterior.The following example creates new routed event data with an initial constructor and then sets the RoutedEvent property as a subsequent operation. Debe tener RoutedEvent establecido antes de provocar el evento enrutado.You must have RoutedEvent set prior to raising the routed event.

protected virtual void OnSelectedColorChanged(Color oldColor, Color newColor)
{

    RoutedPropertyChangedEventArgs<Color> newEventArgs =
        new RoutedPropertyChangedEventArgs<Color>(oldColor, newColor);
    newEventArgs.RoutedEvent = ColorPicker.SelectedColorChangedEvent;
    RaiseEvent(newEventArgs);
}
Protected Overridable Sub OnSelectedColorChanged(ByVal oldColor As Color, ByVal newColor As Color)

	Dim newEventArgs As New RoutedPropertyChangedEventArgs(Of Color)(oldColor, newColor)
	newEventArgs.RoutedEvent = ColorPicker.SelectedColorChangedEvent
	MyBase.RaiseEvent(newEventArgs)
End Sub

Comentarios

No se puede establecer este valor en un RoutedEventArgs que ya se ha enrutado (por ejemplo, si ha obtenido los argumentos a través de un controlador).You cannot set this value on a RoutedEventArgs that has already been routed (for instance, if you obtained the arguments through a handler). Intenta hacer esto, se generará una excepción.Attempting to do so will generate an exception. Solo se puede establecer en una instancia que aún no se ha usado para generar una invocación del evento.You can only set it on an instance that has not yet been used to generate an invocation of the event.

El valor de RoutedEvent no puede ser null en cualquier momento.The value of RoutedEvent cannot be null at any time.

Se aplica a