SoundPlayerAction SoundPlayerAction SoundPlayerAction SoundPlayerAction Class

Definición

Representa un reproducción de audio ligera TriggerAction que se utiliza para reproducir archivos .wav.Represents a lightweight audio playback TriggerAction used to play .wav files.

public ref class SoundPlayerAction : System::Windows::TriggerAction, IDisposable
[System.Windows.Markup.RuntimeNameProperty("Name")]
public class SoundPlayerAction : System.Windows.TriggerAction, IDisposable
type SoundPlayerAction = class
    inherit TriggerAction
    interface IDisposable
Public Class SoundPlayerAction
Inherits TriggerAction
Implements IDisposable
Herencia
Atributos
Implementaciones

Ejemplos

El ejemplo siguiente se muestra cómo utilizar el SoundPlayerAction para desencadenar la reproducción de audio de un archivo .wav mediante un EventTrigger en el Click y MouseEnter eventos.The following example shows how use the SoundPlayerAction to trigger audio playback of a .wav file using an EventTrigger on the Click and MouseEnter events.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <Page.Triggers>
    <EventTrigger RoutedEvent="Button.Click" SourceName="clickButton">
      <EventTrigger.Actions>
        <SoundPlayerAction Source="media\lowbat.wav"/>
      </EventTrigger.Actions>
    </EventTrigger>
    <EventTrigger RoutedEvent="Button.MouseEnter" SourceName="hoverButton">
      <EventTrigger.Actions>
        <SoundPlayerAction Source="media\tada.wav"/>
      </EventTrigger.Actions>
    </EventTrigger>
  </Page.Triggers>

  <StackPanel Width="200">
    <Button Name="clickButton">Click to Play Sound</Button>
    <Button Name="hoverButton">Hover to Play Sound</Button>
  </StackPanel>
</Page>
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <Page.Triggers>
    <EventTrigger RoutedEvent="Button.Click" SourceName="clickButton">
      <EventTrigger.Actions>
        <SoundPlayerAction Source="media\lowbat.wav"/>
      </EventTrigger.Actions>
    </EventTrigger>
    <EventTrigger RoutedEvent="Button.MouseEnter" SourceName="hoverButton">
      <EventTrigger.Actions>
        <SoundPlayerAction Source="media\tada.wav"/>
      </EventTrigger.Actions>
    </EventTrigger>
  </Page.Triggers>

  <StackPanel Width="200">
    <Button Name="clickButton">Click to Play Sound</Button>
    <Button Name="hoverButton">Hover to Play Sound</Button>
  </StackPanel>
</Page>

Constructores

SoundPlayerAction() SoundPlayerAction() SoundPlayerAction() SoundPlayerAction()

Inicializa una nueva instancia de la clase SoundPlayerAction.Initializes a new instance of the SoundPlayerAction class.

Campos

SourceProperty SourceProperty SourceProperty SourceProperty

Identifica la propiedad de dependencia Source.Identifies the Source dependency property.

Propiedades

DependencyObjectType DependencyObjectType DependencyObjectType DependencyObjectType

Obtiene el objeto DependencyObjectType que ajusta el tipo CLRCLR de esta instancia.Gets the DependencyObjectType that wraps the CLRCLR type of this instance.

(Inherited from DependencyObject)
Dispatcher Dispatcher Dispatcher Dispatcher

Obtiene el objeto Dispatcher al que está asociado DispatcherObject.Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
IsSealed IsSealed IsSealed IsSealed

Obtiene un valor que indica si esta instancia está actualmente sellada (es de solo lectura).Gets a value that indicates whether this instance is currently sealed (read-only).

(Inherited from DependencyObject)
Source Source Source Source

Obtiene o establece la ubicación de origen de audio.Gets or sets the audio source location.

Métodos

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

Determina si el subproceso de la llamada tiene acceso a DispatcherObject.Determines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Borra el valor local de una propiedad.Clears the local value of a property. La propiedad que se va a borrar se especifica mediante un identificador DependencyProperty.The property to be cleared is specified by a DependencyProperty identifier.

(Inherited from DependencyObject)
ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey)

Borra el valor local de una propiedad de solo lectura.Clears the local value of a read-only property. La propiedad que se va a borrar se especifica mediante un DependencyPropertyKey.The property to be cleared is specified by a DependencyPropertyKey.

(Inherited from DependencyObject)
CoerceValue(DependencyProperty) CoerceValue(DependencyProperty) CoerceValue(DependencyProperty) CoerceValue(DependencyProperty)

Convierte el valor de la propiedad de dependencia especificada.Coerces the value of the specified dependency property. Esto se logra invocando cualquier función CoerceValueCallback especificada en los metadatos de la propiedad de dependencia tal como existe en la clase DependencyObject que llama.This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

(Inherited from DependencyObject)
Dispose() Dispose() Dispose() Dispose()

Libera los recursos que usa la clase SoundPlayerAction.Releases the resources used by the SoundPlayerAction class.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si un objeto DependencyObject proporcionado es equivalente al objeto DependencyObject actual.Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

(Inherited from DependencyObject)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Obtiene el código hash de DependencyObject.Gets a hash code for this DependencyObject.

(Inherited from DependencyObject)
GetLocalValueEnumerator() GetLocalValueEnumerator() GetLocalValueEnumerator() GetLocalValueEnumerator()

Crea un enumerador especializado para determinar qué propiedades de dependencia han establecido localmente los valores en DependencyObject.Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

(Inherited from DependencyObject)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Devuelve el valor efectivo actual de una propiedad de dependencia en esta instancia de un DependencyObject.Returns the current effective value of a dependency property on this instance of a DependencyObject.

(Inherited from DependencyObject)
InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty)

Vuelve a evaluar el valor efectivo para la propiedad de dependencia especificada.Re-evaluates the effective value for the specified dependency property

(Inherited from DependencyObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs)

Se invoca cuando se actualiza el valor efectivo de alguna propiedad de dependencia en este DependencyObject.Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. Se informa de la propiedad de dependencia concreta que cambió en los datos de evento.The specific dependency property that changed is reported in the event data.

(Inherited from DependencyObject)
ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Devuelve el valor local de una propiedad de dependencia, si existe.Returns the local value of a dependency property, if it exists.

(Inherited from DependencyObject)
SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object)

Establece el valor de una propiedad de dependencia sin cambiar el origen del valor.Sets the value of a dependency property without changing its value source.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object)

Establece el valor local de una propiedad de dependencia, especificado mediante el identificador de la propiedad de dependencia.Sets the local value of a dependency property, specified by its dependency property identifier.

(Inherited from DependencyObject)
SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object)

Establece el valor local de una propiedad de dependencia de solo lectura, especificado por el identificador DependencyPropertyKey de la propiedad de dependencia.Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.

(Inherited from DependencyObject)
ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty)

Devuelve un valor que indica si los procesos de serialización deben serializar el valor de la propiedad de dependencia especificada.Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

(Inherited from DependencyObject)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

Exige que el subproceso de la llamada tenga acceso a DispatcherObject.Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

Se aplica a