|
|
|
|
<Window x:Class="MediaPlayer.MainWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:local="clr-namespace:MediaPlayer"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
Title="MainWindow" Height="450" Width="800">
|
|
|
|
|
<Grid Margin="5">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<RowDefinition Height="30"/>
|
|
|
|
|
<RowDefinition Height="50"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<MediaElement x:Name="mediaElem" Grid.Row="0"
|
|
|
|
|
LoadedBehavior="Manual" UnloadedBehavior="Stop"
|
|
|
|
|
MediaOpened="mediaElem_MediaOpened"
|
|
|
|
|
MediaEnded="mediaElem_MediaEnded"
|
|
|
|
|
MediaFailed="mediaElem_MediaFailed"/>
|
|
|
|
|
<Slider x:Name="playSlider" Grid.Row="1" Margin="20 0 20 0" VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
|
|
|
|
Thumb.DragStarted="playSlider_DragStarted"
|
|
|
|
|
Thumb.DragCompleted="playSlider_DragCompleted"
|
|
|
|
|
ValueChanged="playSlider_ValueChanged"/>
|
|
|
|
|
<Grid Grid.Row="2" Margin="20 0 20 0">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="200"/>
|
|
|
|
|
<ColumnDefinition Width="150"/>
|
|
|
|
|
<ColumnDefinition Width="150"/>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
|
|
|
|
<Button x:Name="playButton" Width="50" Height="30" Margin="5" Content="Play"
|
|
|
|
|
Click="playButton_Click"/>
|
|
|
|
|
<Button x:Name="PauseButton" Width="50" Height="30" Margin="5" Content="Pause"
|
|
|
|
|
Click="PauseButton_Click"/>
|
|
|
|
|
<Button x:Name="StopButton" Width="50" Height="30" Margin="5" Content="Stop"
|
|
|
|
|
Click="StopButton_Click"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
|
|
|
<Label Content="Volume" VerticalAlignment="Center"/>
|
|
|
|
|
<Slider x:Name="volumeSlider" Width="100" VerticalAlignment="Center"
|
|
|
|
|
Maximum="1" LargeChange="0.1" Value="0.5"
|
|
|
|
|
ValueChanged="volumeSlider_ValueChanged"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<Label x:Name="playTimeLabel" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
|
Content="00:00:00 / 00:00:00"/>
|
|
|
|
|
<Button x:Name="openButton" Grid.Column="4" Width="50" Height="30" HorizontalAlignment="Right" Content="Open"
|
|
|
|
|
Click="openButton_Click"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|