TimelineMarker 類別

定義

表示與媒體檔案中特定點相關聯的中繼資料。

public ref class TimelineMarker sealed : DependencyObject
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class TimelineMarker final : DependencyObject
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class TimelineMarker final : DependencyObject
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class TimelineMarker : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class TimelineMarker : DependencyObject
Public NotInheritable Class TimelineMarker
Inherits DependencyObject
繼承
Object Platform::Object IInspectable DependencyObject TimelineMarker
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

下列範例會建立 MediaElement 物件,並回應其 MarkerReached 事件。 每次到達時間軸標記時,此範例都會顯示時間軸標記的時間、類型和文字值。

<MediaElement Name="Media" Source="video.mp4" MarkerReached="Media_MarkerReached" />
<TextBlock Name="txOutput" />
private void Media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e)
{
    txOutput.Text =
        string.Format("{0},{1},{2}", e.Marker.Time, e.Marker.Text, e.Marker.Type);
}

備註

時間軸標記是與媒體檔案中特定點相關聯的中繼資料。 這些標記通常會事先建立,並儲存在媒體檔案本身中。 它們通常用來命名影片中的不同場景,或提供腳本提示。藉由處理 MediaElement 物件的 MarkerReached 事件或存取 MediaElement 物件的 Markers 屬性,您可以使用時間表標記來觸發動作,或讓使用者搜尋媒體檔案中選取的位置。

建構函式

TimelineMarker()

初始化 TimelineMarker 類別的新實例。

屬性

Dispatcher

取得與此物件相關聯的 CoreDispatcherCoreDispatcher代表可以存取 UI 執行緒上DependencyObject的功能,即使程式碼是由非 UI 執行緒起始也一樣。

(繼承來源 DependencyObject)
Text

取得或設定 TimelineMarker的文字值。

TextProperty

識別 Text 相依性屬性。

Time

取得或設定到達 TimelineMarker 的時間。

TimeProperty

識別 時間 相依性屬性。

Type

取得或設定 TimelineMarker的標記類型。

TypeProperty

識別 Type 相依性屬性。

方法

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

傳回針對相依性屬性所建立的任何基底值,如果動畫未使用中,則會套用。

(繼承來源 DependencyObject)
GetValue(DependencyProperty)

DependencyObject傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此DependencyObject實例上特定DependencyProperty的變更。

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)

DependencyObject上設定相依性屬性的本機值。

(繼承來源 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback註冊的變更通知。

(繼承來源 DependencyObject)

適用於

另請參閱