feat: 样式支持自定义视频

This commit is contained in:
denglihong2007
2025-04-04 01:15:13 +08:00
parent 6669f57c12
commit 8bfed0d19e
6 changed files with 46 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
<Window x:Class="CRSim.ScreenSimulator.Views.ChengduMetro.PlatformScreenView"
<Window x:Class="CRSim.ScreenSimulator.Views.ChengduMetro.PlatformScreenView"
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"
@@ -106,7 +106,8 @@
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<MediaElement Grid.Row="0" Name="player" HorizontalAlignment="Center" VerticalAlignment="Stretch" LoadedBehavior="Manual" UnloadedBehavior="Stop" Volume="0" MediaEnded="MediaElement_MediaEnded"/>
<MediaElement Grid.Row="0" Name="player" HorizontalAlignment="Center" VerticalAlignment="Stretch"
LoadedBehavior="Manual" UnloadedBehavior="Stop" Volume="0" MediaEnded="MediaElement_MediaEnded" Source="{Binding ViewModel.Video}"/>
<pp:RunningText Grid.Row="1" x:Name="rt" Background="Orange" Foreground="White" Padding="4" FontSize="20" Speed="75"
Text="{Binding ViewModel.Text,Mode=OneWay}">
<pp:RunningText.Style>

View File

@@ -17,7 +17,6 @@ namespace CRSim.ScreenSimulator.Views.ChengduMetro
ViewModel = viewModel;
RenderOptions.SetEdgeMode(this, EdgeMode.Aliased);
DataContext = this;
player.Source = new Uri("Assets\\Advertisement.mp4", UriKind.Relative);
player.Play();
}
private void Window_MouseDown(object sender, MouseButtonEventArgs e)