Remove style

This commit is contained in:
Jojo Zhou 2023-05-10 19:42:06 -04:00
parent 80447106f1
commit 48878cb051

View File

@ -12,340 +12,6 @@
xmlns:previewers="using:Peek.FilePreviewer.Previewers"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<Style BasedOn="{StaticResource DefaultMediaTransportControlsStyle}" TargetType="MediaTransportControls" />
<Style x:Key="DefaultMediaTransportControlsStyle" TargetType="MediaTransportControls">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Margin" Value="{ThemeResource MediaTransportControlsMargin}" />
<Setter Property="MaxWidth" Value="{ThemeResource MediaTransportControlsMaxWidth}" />
<Setter Property="MinWidth" Value="{ThemeResource MediaTransportControlsMinWidth}" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MediaTransportControls">
<Grid x:Name="RootGrid" Background="Transparent">
<Grid.Resources>
<!-- New AppBar button style 40x40 pixels in size -->
<Style
x:Key="AppBarButtonStyle"
BasedOn="{StaticResource DefaultAppBarButtonStyle}"
TargetType="AppBarButton">
<Setter Property="Height" Value="{ThemeResource MediaTransportControlsAppBarButtonHeight}" />
<Setter Property="Width" Value="{ThemeResource MediaTransportControlsAppBarButtonWidth}" />
<Setter Property="AllowFocusOnInteraction" Value="True" />
</Style>
<!-- New AppBarToggle button style 40x40 pixels in size -->
<Style
x:Key="AppBarToggleButtonStyle"
BasedOn="{StaticResource DefaultAppBarToggleButtonStyle}"
TargetType="AppBarToggleButton">
<Setter Property="Height" Value="{ThemeResource MediaTransportControlsAppBarButtonHeight}" />
<Setter Property="Width" Value="{ThemeResource MediaTransportControlsAppBarButtonWidth}" />
<Setter Property="AllowFocusOnInteraction" Value="True" />
</Style>
<!-- New CommandBar Style -->
<Style
x:Key="CommandBarStyle"
BasedOn="{StaticResource DefaultCommandBarStyle}"
TargetType="CommandBar">
<Setter Property="Background" Value="Transparent" />
<Setter Property="DefaultLabelPosition" Value="Collapsed" />
</Style>
<!-- Style for Error Message text -->
<Style x:Key="MediaTextBlockStyle" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{ThemeResource MediaTransportControlsFillMediaText}" />
<Setter Property="FontSize" Value="{ThemeResource MTCMediaFontSize}" />
<Setter Property="FontFamily" Value="{ThemeResource MTCMediaFontFamily}" />
<Setter Property="Style" Value="{ThemeResource CaptionTextBlockStyle}" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
</Style>
<!-- Style for Volume Flyout used in Media Transport Controls -->
<Style
x:Key="FlyoutStyle"
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}"
TargetType="FlyoutPresenter">
<Setter Property="Background" Value="{ThemeResource MediaTransportControlsFlyoutBackground}" />
<Setter Property="Padding" Value="0" />
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
</Style>
<Style
x:Key="MediaSliderStyle"
BasedOn="{StaticResource DefaultSliderStyle}"
TargetType="Slider" />
<Style
x:Key="MediaControlAppBarButtonStyle"
BasedOn="{StaticResource DefaultAppBarButtonStyle}"
TargetType="AppBarButton" />
</Grid.Resources>
<Border x:Name="ControlPanel_ControlPanelVisibilityStates_Border">
<Grid
x:Name="ControlPanelGrid"
VerticalAlignment="Bottom"
Background="{ThemeResource MediaTransportControlsPanelBackground}"
BorderBrush="{ThemeResource MediaTransportControlsBorderBrush}"
BorderThickness="{ThemeResource MediaTransportControlsBorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TranslateTransform x:Name="TranslateVertical" />
</Grid.RenderTransform>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border
x:Name="ErrorBorder"
Grid.ColumnSpan="3"
Width="320"
Height="96"
HorizontalAlignment="Center"
Background="{ThemeResource MediaTransportControlsPanelBackground}"
Visibility="Collapsed">
<TextBlock
x:Name="ErrorTextBlock"
Margin="12"
Style="{StaticResource CaptionTextBlockStyle}"
TextWrapping="WrapWholeWords" />
</Border>
<Border
x:Name="MediaTransportControls_Timeline_Border"
Grid.Row="1"
Grid.Column="1">
<Grid x:Name="MediaTransportControls_Timeline_Grid">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Slider
x:Name="ProgressSlider"
Height="{ThemeResource MediaTransportControlsSliderHeight}"
MinWidth="80"
Margin="7,2,7,1"
VerticalAlignment="Center"
IsThumbToolTipEnabled="False" />
<ProgressBar
x:Name="BufferingProgressBar"
Height="4"
Margin="0,2,0,0"
VerticalAlignment="Center"
IsHitTestVisible="False"
IsIndeterminate="True"
Visibility="Collapsed" />
<Grid
x:Name="TimeTextGrid"
Grid.Row="1"
Height="16"
Margin="7,0,7,2">
<TextBlock
x:Name="TimeElapsedElement"
Margin="0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Style="{StaticResource CaptionTextBlockStyle}"
Text="00:00" />
<TextBlock
x:Name="TimeRemainingElement"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Style="{StaticResource CaptionTextBlockStyle}"
Text="00:00" />
</Grid>
</Grid>
</Border>
<Border
x:Name="LeftSidePlayBorder"
Grid.Row="1"
Grid.Column="0"
Visibility="Collapsed">
<AppBarButton
x:Name="PlayPauseButtonOnLeft"
Margin="0"
VerticalAlignment="Center"
Style="{StaticResource AppBarButtonStyle}">
<AppBarButton.Resources>
<Thickness x:Key="AppBarButtonInnerBorderMargin">5</Thickness>
<Thickness x:Key="AppBarButtonContentViewboxCollapsedMargin">0,12</Thickness>
</AppBarButton.Resources>
<AppBarButton.Icon>
<FontIcon x:Name="PlayPauseSymbolLeft" Glyph="&#xF5B0;" />
</AppBarButton.Icon>
</AppBarButton>
</Border>
<Border
x:Name="MediaTransportControls_Command_Border"
Grid.Row="2"
Grid.Column="1">
<CommandBar
x:Name="MediaControlsCommandBar"
Margin="0,3"
IsDynamicOverflowEnabled="False"
Style="{StaticResource CommandBarStyle}">
<CommandBar.Resources>
<Thickness x:Key="AppBarButtonInnerBorderMargin">5</Thickness>
<Thickness x:Key="AppBarButtonContentViewboxCollapsedMargin">0,12</Thickness>
<x:Double x:Key="AppBarThemeCompactHeight">40</x:Double>
<x:Double x:Key="AppBarMoreButtonColumnMinWidth">0</x:Double>
</CommandBar.Resources>
<CommandBar.PrimaryCommands>
<AppBarButton
x:Name="VolumeMuteButton"
MediaTransportControlsHelper.DropoutOrder="19"
Style="{StaticResource AppBarButtonStyle}">
<AppBarButton.Flyout>
<Flyout
x:Name="VolumeFlyout"
FlyoutPresenterStyle="{StaticResource FlyoutStyle}"
ShouldConstrainToRootBounds="False">
<StackPanel Padding="3,11" Orientation="Horizontal">
<AppBarButton
x:Name="AudioMuteButton"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource AppBarButtonStyle}">
<AppBarButton.Resources>
<Thickness x:Key="AppBarButtonContentViewboxCollapsedMargin">0,12</Thickness>
<Thickness x:Key="AppBarButtonInnerBorderMargin">5</Thickness>
</AppBarButton.Resources>
<AppBarButton.Icon>
<SymbolIcon x:Name="AudioMuteSymbol" Symbol="Volume" />
</AppBarButton.Icon>
</AppBarButton>
<Slider
x:Name="VolumeSlider"
Width="{ThemeResource MediaTransportControlsSliderWidth}"
Height="{ThemeResource MediaTransportControlsSliderHeight}"
Margin="12,0,8,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsThumbToolTipEnabled="False"
Value="50" />
<TextBlock
x:Name="VolumeValue"
Width="24"
Margin="8,0,16,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource MediaTextBlockStyle}"
Text="{Binding ElementName=VolumeSlider, Path=Value}"
TextAlignment="Right" />
</StackPanel>
</Flyout>
</AppBarButton.Flyout>
<AppBarButton.Icon>
<SymbolIcon x:Name="VolumeMuteSymbol" Symbol="Volume" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton
x:Name="PlayPauseButton"
MediaTransportControlsHelper.DropoutOrder="23"
Style="{StaticResource AppBarButtonStyle}">
<AppBarButton.Icon>
<FontIcon x:Name="PlayPauseSymbol" Glyph="&#xF5B0;" />
</AppBarButton.Icon>
</AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Border>
</Grid>
</Border>
<VisualStateManager.VisualStateGroups>
<!-- Media state visual states -->
<VisualStateGroup x:Name="MediaStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Buffering">
<VisualState.Setters>
<Setter Target="BufferingProgressBar.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Loading">
<VisualState.Setters>
<Setter Target="BufferingProgressBar.Visibility" Value="Visible" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ProgressSlider"
Storyboard.TargetProperty="Opacity"
To="0"
Duration="0" />
<DoubleAnimation
Storyboard.TargetName="MediaControlsCommandBar"
Storyboard.TargetProperty="Opacity"
To="0"
Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Error">
<VisualState.Setters>
<Setter Target="ErrorBorder.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard />
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="MediaTransportControlMode">
<VisualState x:Name="NormalMode" />
<VisualState x:Name="CompactMode">
<VisualState.Setters>
<Setter Target="LeftSidePlayBorder.Visibility" Value="Visible" />
<Setter Target="TimeTextGrid.Visibility" Value="Collapsed" />
<Setter Target="MediaTransportControls_Command_Border.(Grid.Column)" Value="2" />
<Setter Target="MediaTransportControls_Command_Border.(Grid.Row)" Value="1" />
<Setter Target="ControlPanelGrid.Height" Value="48" />
<Setter Target="MediaControlsCommandBar.Margin" Value="0" />
<Setter Target="PlayPauseButton.Visibility" Value="Collapsed" />
<Setter Target="ProgressSlider.Margin" Value="{ThemeResource MediaTransportControlsProgressSliderCompactMargin}" />
<Setter Target="ControlPanelGrid.Padding" Value="3" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<!-- PlayPause states -->
<VisualStateGroup x:Name="PlayPauseStates">
<VisualState x:Name="PlayState" />
<VisualState x:Name="PauseState">
<VisualState.Setters>
<Setter Target="PlayPauseSymbolLeft.Glyph" Value="&#xF8AE;" />
<Setter Target="PlayPauseSymbol.Glyph" Value="&#xF8AE;" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<!-- VolumeMute states -->
<VisualStateGroup x:Name="VolumeMuteStates">
<VisualState x:Name="VolumeState" />
<VisualState x:Name="MuteState">
<VisualState.Setters>
<Setter Target="AudioMuteSymbol.Symbol" Value="Mute" />
<Setter Target="VolumeMuteSymbol.Symbol" Value="Mute" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<ProgressRing
HorizontalAlignment="Center"