You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
164 lines
7.7 KiB
164 lines
7.7 KiB
<Window x:Class="AIK.Views.MenuPages.CommonPage.VideoPopupWindow"
|
|
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:AIK.Views.MenuPages.CommonPage"
|
|
mc:Ignorable="d"
|
|
Title="视频播放"
|
|
Height="600"
|
|
Width="800"
|
|
WindowStyle="None"
|
|
AllowsTransparency="True"
|
|
Background="Transparent"
|
|
WindowStartupLocation="CenterScreen">
|
|
<WindowChrome.WindowChrome>
|
|
<WindowChrome GlassFrameThickness="0"
|
|
ResizeBorderThickness="5"
|
|
CaptionHeight="40"
|
|
UseAeroCaptionButtons="False"
|
|
/>
|
|
</WindowChrome.WindowChrome>
|
|
<Border Background="#FF1A1A1A" CornerRadius="10">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<!-- 标题栏 -->
|
|
<Border Grid.Row="0" Background="#FF2D2D2D" CornerRadius="10,10,0,0" Height="40" WindowChrome.IsHitTestVisibleInChrome="True">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="200"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!--标题-->
|
|
<TextBlock Text="{Binding VideoTitle}"
|
|
Foreground="White"
|
|
FontSize="16"
|
|
FontWeight="SemiBold"
|
|
VerticalAlignment="Center"
|
|
Margin="15,0" Grid.Column="0"/>
|
|
<!--关闭按钮-->
|
|
<!-- 关闭按钮容器 -->
|
|
<Border Grid.Column="1"
|
|
Background="Transparent"
|
|
Width="40"
|
|
Height="40"
|
|
HorizontalAlignment="Right" Panel.ZIndex="100">
|
|
<Button Content="✕"
|
|
Command="{Binding CloseCommand}"
|
|
Width="30"
|
|
Height="30"
|
|
FontSize="14"
|
|
Background="Transparent"
|
|
Foreground="White"
|
|
BorderThickness="0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Margin="0,0,5,0">
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border x:Name="border"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="18">
|
|
<ContentPresenter HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#FFE81123"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 视频播放区域 -->
|
|
<Border Grid.Row="1" Margin="10" Background="Black" CornerRadius="5">
|
|
<MediaElement x:Name="MediaPlayer"
|
|
LoadedBehavior="Manual"
|
|
UnloadedBehavior="Stop"
|
|
Stretch="Uniform"
|
|
MediaOpened="MediaPlayer_MediaOpened"
|
|
MediaEnded="MediaPlayer_MediaEnded"/>
|
|
</Border>
|
|
|
|
<!-- 控制栏 -->
|
|
<Border Grid.Row="2" Background="#FF2D2D2D" CornerRadius="0,0,10,10"
|
|
Height="60">
|
|
<Grid Margin="10,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- 播放/暂停按钮 -->
|
|
<Button x:Name="PlayPauseButton"
|
|
Grid.Column="0"
|
|
Content="▶"
|
|
Command="{Binding PlayPauseCommand}"
|
|
Style="{StaticResource VideoControlButtonStyle}"/>
|
|
|
|
<!-- 进度条 -->
|
|
<StackPanel Grid.Column="1" Orientation="Vertical"
|
|
VerticalAlignment="Center" Margin="15,0">
|
|
<Slider x:Name="ProgressSlider"
|
|
Minimum="0"
|
|
Maximum="100"
|
|
Value="{Binding Progress, Mode=TwoWay}"
|
|
Thumb.DragStarted="ProgressSlider_DragStarted"
|
|
Thumb.DragCompleted="ProgressSlider_DragCompleted">
|
|
<Slider.Style>
|
|
<Style TargetType="Slider">
|
|
<Setter Property="Background" Value="#555"/>
|
|
<Setter Property="Foreground" Value="#0078D7"/>
|
|
</Style>
|
|
</Slider.Style>
|
|
</Slider>
|
|
|
|
<Grid>
|
|
<TextBlock Text="{Binding CurrentTime}"
|
|
Foreground="White" FontSize="10"/>
|
|
<TextBlock Text="{Binding TotalTime}"
|
|
Foreground="White" FontSize="10"
|
|
HorizontalAlignment="Right"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<!-- 音量控制 -->
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal"
|
|
VerticalAlignment="Center" Margin="10,10">
|
|
<Button x:Name="VolumeButton"
|
|
Content="🔊"
|
|
Command="{Binding ToggleMuteCommand}"
|
|
Style="{StaticResource VideoControlButtonStyle}"/>
|
|
|
|
<Slider Width="80" Margin="0,10,0,0" Minimum="0" Maximum="1"
|
|
Value="{Binding Volume, Mode=TwoWay}"
|
|
TickFrequency="0.1"/>
|
|
</StackPanel>
|
|
|
|
<!-- 全屏按钮 -->
|
|
<Button Grid.Column="3"
|
|
Content="⛶"
|
|
Command="{Binding ToggleFullScreenCommand}"
|
|
Style="{StaticResource VideoControlButtonStyle}"/>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</Window>
|
|
|