SoundPlayerAction SoundPlayerAction SoundPlayerAction SoundPlayerAction Class

정의

.wav 파일을 재생하는 데 사용되는 간단한 오디오 재생 TriggerAction을 나타냅니다.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
상속
특성
구현

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 SoundPlayerAction 를 사용 하 여.wav 파일의 오디오 재생을 트리거하는 EventTriggerClickMouseEnter 이벤트.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>

생성자

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

SoundPlayerAction 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the SoundPlayerAction class.

필드

SourceProperty SourceProperty SourceProperty SourceProperty

Source 종속성 속성을 나타냅니다.Identifies the Source dependency property.

속성

DependencyObjectType DependencyObjectType DependencyObjectType DependencyObjectType

이 인스턴스의 CLRCLR 형식을 래핑하는 DependencyObjectType을 가져옵니다.Gets the DependencyObjectType that wraps the CLRCLR type of this instance.

(Inherited from DependencyObject)
Dispatcher Dispatcher Dispatcher Dispatcher

Dispatcher와 연결된 DispatcherObject를 가져옵니다.Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
IsSealed IsSealed IsSealed IsSealed

이 인스턴스가 현재 봉인되어 있는지(읽기 전용인지) 여부를 나타내는 값을 가져옵니다.Gets a value that indicates whether this instance is currently sealed (read-only).

(Inherited from DependencyObject)
Source Source Source Source

오디오 소스 위치를 가져오거나 설정합니다.Gets or sets the audio source location.

메서드

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

호출 스레드가 이 DispatcherObject에 액세스할 수 있는지 여부를 확인합니다.Determines whether the calling thread has access to this DispatcherObject.

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

속성의 로컬 값을 지웁니다.Clears the local value of a property. 지울 속성이 DependencyProperty 식별자에서 지정됩니다.The property to be cleared is specified by a DependencyProperty identifier.

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

읽기 전용 속성의 로컬 값을 지웁니다.Clears the local value of a read-only property. 선언할 속성이 DependencyPropertyKey에서 지정됩니다.The property to be cleared is specified by a DependencyPropertyKey.

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

지정된 종속성 속성의 값을 강제 변환합니다.Coerces the value of the specified dependency property. 호출하는 DependencyObject에 있으므로 이 작업은 종속성 속성의 속성 메타데이터에 지정된 CoerceValueCallback 함수를 호출하여 수행합니다.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()

SoundPlayerAction 클래스에서 사용하는 리소스를 해제합니다.Releases the resources used by the SoundPlayerAction class.

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

제공된 DependencyObject가 현재 DependencyObject에 해당하는지 여부를 확인합니다.Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

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

DependencyObject의 해시 코드를 가져옵니다.Gets a hash code for this DependencyObject.

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

DependencyObject에 대해 로컬로 값을 설정한 종속성 속성을 확인하기 위한 특수 열거자를 만듭니다.Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

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

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

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

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)

지정된 종속성 속성의 유효 값을 다시 계산합니다.Re-evaluates the effective value for the specified dependency property

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

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

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

DependencyObject에서 종속성 속성의 유효 값이 업데이트될 때마다 호출됩니다.Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. 변경된 특정 종속성 속성은 이벤트 데이터에서 보고됩니다.The specific dependency property that changed is reported in the event data.

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

종속성 속성의 로컬 값을 반환합니다(있는 경우).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)

해당 값 소스를 변경하지 않고 종속성 속성의 값을 설정합니다.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)

지정된 종속성 속성 식별자를 가진 종속성 속성의 로컬 값을 설정합니다.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)

종속성 속성의 DependencyPropertyKey 식별자에 의해 지정된 읽기 전용 종속성 속성의 로컬 값을 설정합니다.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)

serialization 프로세스에서 지정된 종속성 속성의 값을 직렬화해야 하는지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

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

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

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

호출 스레드에서 이 DispatcherObject에 액세스할 수 있는지 확인합니다.Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

적용 대상