|
26 | 26 | </WindowChrome.WindowChrome> |
27 | 27 |
|
28 | 28 | <Window.Resources> |
| 29 | + <Style x:Key="CoverGrid" TargetType="Grid"> |
| 30 | + <Setter Property="Width" Value="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}" /> |
| 31 | + <Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}" /> |
| 32 | + </Style> |
| 33 | + |
| 34 | + <Style x:Key="CoverViewbox" TargetType="Viewbox"> |
| 35 | + <Setter Property="Width" Value="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Grid}}" /> |
| 36 | + <Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Grid}}" /> |
| 37 | + <Setter Property="Stretch" Value="Fill" /> |
| 38 | + <Setter Property="StretchDirection" Value="Both" /> |
| 39 | + <Setter Property="Grid.Row" Value="0" /> |
| 40 | + <Setter Property="Grid.Column" Value="0" /> |
| 41 | + <Setter Property="Grid.ColumnSpan" Value="99" /> |
| 42 | + <Setter Property="Margin" Value="0" /> |
| 43 | + </Style> |
| 44 | + |
29 | 45 | <Style x:Key="CoverIcon" TargetType="materialDesign:PackIcon" BasedOn="{StaticResource {x:Type materialDesign:PackIcon}}"> |
30 | 46 | <Setter Property="HorizontalAlignment" Value="Center" /> |
31 | 47 | <Setter Property="VerticalAlignment" Value="Center" /> |
|
92 | 108 | </Grid.RowDefinitions> |
93 | 109 |
|
94 | 110 | <Image Margin="0" Grid.Column="0" Grid.ColumnSpan="99" Grid.Row="0" Source="{Binding Cover}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding IsPrivateSession, Converter={StaticResource InverseBoolToVisConverter}}"/> |
95 | | - |
96 | | - <Viewbox StretchDirection="Both" Stretch="Fill" |
97 | | - Margin="0" Grid.Column="0" Grid.ColumnSpan="99" Grid.Row="0" |
98 | | - Height="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Grid}}" |
99 | | - Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Grid}}"> |
| 111 | + |
| 112 | + <Viewbox Style="{StaticResource CoverViewbox}"> |
100 | 113 | <TextBlock Text="{Binding CurrentVolumeString, NotifyOnTargetUpdated=True}" FontSize="50" TextAlignment="Center" Style="{StaticResource animateFadeOut}"/> |
101 | 114 | </Viewbox> |
102 | | - |
103 | | - <Viewbox StretchDirection="Both" Stretch="Fill" |
104 | | - Visibility="{Binding IsPrivateSession, Converter={StaticResource BooleanToVisibilityConverter}}" |
105 | | - Margin="0" Grid.Column="0" Grid.ColumnSpan="99" Grid.Row="0" |
106 | | - Height="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Grid}}" |
107 | | - Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Grid}}"> |
| 115 | + |
| 116 | + <Viewbox Style="{StaticResource CoverViewbox}" |
| 117 | + Visibility="{Binding IsPrivateSession, Converter={StaticResource BooleanToVisibilityConverter}}"> |
108 | 118 | <materialDesign:PackIcon Kind="Incognito" /> |
109 | 119 | </Viewbox> |
110 | 120 |
|
111 | 121 | <Canvas Grid.Row="0" Grid.Column="0" Background="Transparent" MouseLeftButtonDown="CanvasLeft_MouseLeftButtonDown"> |
112 | | - <Grid |
113 | | - Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}" |
114 | | - Height="{Binding ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}"> |
| 122 | + <Grid Style="{StaticResource CoverGrid}"> |
115 | 123 | <materialDesign:PackIcon Kind="SkipPrevious" Style="{StaticResource CoverIcon}" /> |
116 | 124 | </Grid> |
117 | 125 | </Canvas> |
118 | 126 | <Canvas Grid.Row="0" Grid.Column="1" Background="Transparent" MouseLeftButtonDown="CanvasMid_MouseLeftButtonDown"> |
119 | | - <Grid |
120 | | - Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}" |
121 | | - Height="{Binding ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}"> |
| 127 | + <Grid Style="{StaticResource CoverGrid}"> |
122 | 128 | <materialDesign:PackIcon Kind="PlayPause" Style="{StaticResource CoverIcon}" /> |
123 | 129 | </Grid> |
124 | 130 | </Canvas> |
125 | | - <Canvas Grid.Row="0" Grid.Column="2" Background="Transparent" MouseLeftButtonDown="CanvasRight_MouseLeftButtonDown" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
126 | | - <Grid |
127 | | - Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}" |
128 | | - Height="{Binding ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor,AncestorLevel=1,AncestorType=Canvas}}"> |
| 131 | + <Canvas Grid.Row="0" Grid.Column="2" Background="Transparent" MouseLeftButtonDown="CanvasRight_MouseLeftButtonDown"> |
| 132 | + <Grid Style="{StaticResource CoverGrid}"> |
129 | 133 | <materialDesign:PackIcon Kind="SkipNext" Style="{StaticResource CoverIcon}" /> |
130 | 134 | </Grid> |
131 | 135 | </Canvas> |
132 | | - |
| 136 | + |
133 | 137 | <ToggleButton Grid.Column="0" Style="{StaticResource CoverToggle}" VerticalAlignment="Bottom" x:Name="TopMostToggle" HorizontalAlignment="Left"/> |
134 | 138 | </Grid> |
135 | 139 | </Window> |
0 commit comments