|
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SkinableVideoPlayer_View"
xmlns:SkinableVideoPlayer="clr-namespace:SkinableVideoPlayer;assembly=SkinableVideoPlayerViewModel"
x:Name="userControl"
mc:Ignorable="d"
x:Class="SkinableVideoPlayer_View.MainPage"
UseLayoutRounding="True" d:DesignWidth="600" d:DesignHeight="350">
<UserControl.DataContext>
<SkinableVideoPlayer:MainViewModel/>
</UserControl.DataContext>
<Grid x:Name="LayoutRoot" Background="White" Width="600" Height="350">
<Grid.RowDefinitions>
<RowDefinition Height="0.914*"/>
<RowDefinition Height="0.086*"/>
</Grid.RowDefinitions>
<i:Interaction.Triggers>
<i:EventTrigger>
<i:InvokeCommandAction x:Name="SetMediaElement" Command="{Binding SetMediaElementCommand}" CommandParameter="{Binding ElementName=mediaElement, Mode=OneWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<MediaElement x:Name="mediaElement" Source="{Binding SelectedVideoProperty}" AutoPlay="False" Margin="0,9,0,66">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MediaOpened">
<i:InvokeCommandAction x:Name="SetSeekCommand" Command="{Binding SetSeekControlCommand}" CommandParameter="{Binding ElementName=progressBar}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</MediaElement>
<Grid x:Name="PlayerControls" VerticalAlignment="Top" Grid.Row="1" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Orientation="Horizontal">
<Button x:Name="RewindButton" Content="<<" Width="27" HorizontalAlignment="Left">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction x:Name="RewindCommand" Command="{Binding RewindVideoCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button x:Name="PlayButton" Content="Play" Width="75" HorizontalAlignment="Left" Margin="5,0,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction x:Name="PlayCommand" Command="{Binding PlayVideoCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button x:Name="StopButton" Content="Stop" Width="68" HorizontalAlignment="Left" Margin="5,0,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction x:Name="StopCommand" Command="{Binding StopVideoCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button x:Name="PauseButton" Content="Pause" Width="75" HorizontalAlignment="Left" Margin="5,0,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction x:Name="PauseCommand" Command="{Binding PauseVideoCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button x:Name="ForwardButton" Content=">>" Width="27" HorizontalAlignment="Left" Margin="5,0,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction x:Name="ForwardCommand" Command="{Binding ForwardVideoCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Slider Maximum="1" LargeChange="0.5" Value="{Binding Volume, ElementName=mediaElement, Mode=TwoWay}" Width="49" HorizontalAlignment="Left" Height="22" Margin="10,0,0,0"/>
</StackPanel>
</Grid>
<ProgressBar x:Name="progressBar" Height="16" Margin="193,0,219,34" VerticalAlignment="Bottom" Maximum="{Binding TotalDurationProperty}" Value="{Binding CurrentPositionProperty, Mode=TwoWay}"/>
<StackPanel x:Name="DisplayPanel" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,293,0,0">
<TextBlock x:Name="ProgressDisplay" Text="{Binding CurrentProgressProperty}" TextAlignment="Center" Height="12" RenderTransformOrigin="0.5,0.5" d:LayoutOverrides="HorizontalAlignment">
<TextBlock.RenderTransform>
<CompositeTransform/>
</TextBlock.RenderTransform>
</TextBlock>
<ComboBox x:Name="VideoList" ItemsSource="{Binding SilverlightVideoList}" SelectedIndex="{Binding SelectedVideoInListProperty}" Margin="10,0,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="DropDownClosed">
<i:InvokeCommandAction x:Name="SetVideo" Command="{Binding SetVideoCommand}" CommandParameter="{Binding SelectedItem, ElementName=VideoList}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<toolkit:BusyIndicator Content="" Margin="229,156,260,0" VerticalAlignment="Top" IsBusy="{Binding MediaBufferingProperty}" Height="58" BusyContent="{Binding MediaBufferingTimeProperty}"/>
</Grid>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.