|
6 | 6 | xmlns:lottie="using:Microsoft.Toolkit.Uwp.UI.Lottie" |
7 | 7 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewmodel="using:LottieViewer.ViewModel" |
8 | 8 | Visibility="Visible" |
9 | | - mc:Ignorable="d"> |
| 9 | + mc:Ignorable="d" |
| 10 | + RequestedTheme="Dark" |
| 11 | + PointerPressed="Page_PointerPressed" > |
10 | 12 | <Page.Resources> |
11 | | - <local:VisiblityConverter x:Key="VisibilityConverter" /> |
| 13 | + <local:VisibilityConverter x:Key="VisibilityConverter" /> |
12 | 14 | <local:FloatFormatter x:Key="floatFormatter" /> |
13 | 15 | <SolidColorBrush x:Name="ArtboardBrush" |
14 | 16 | Color="{x:Bind BackgroundColor.Color, Mode=OneWay}" /> |
| 17 | + |
| 18 | + <!-- |
| 19 | + Color for Hyperlink. Use this to override the default Foreground |
| 20 | + color on Hyperlink so that it is visible on the gray background |
| 21 | + (otherwise the Hyperlink color will be themed and may become |
| 22 | + unreadable). |
| 23 | + --> |
| 24 | + <StaticResource x:Key="LottieHyperlinkForegroundBrush" |
| 25 | + ResourceKey="LottieBasicBrush" /> |
15 | 26 | </Page.Resources> |
16 | 27 |
|
17 | 28 | <RelativePanel AllowDrop="True" |
|
127 | 138 | <DataTemplate x:DataType="lottie:Issue"> |
128 | 139 | <StackPanel Orientation="Horizontal"> |
129 | 140 | <TextBlock MinWidth="60"> |
130 | | - <Hyperlink NavigateUri="{x:Bind Url}"><Run FontWeight="Bold" |
| 141 | + <Hyperlink Foreground="{StaticResource LottieHyperlinkForegroundBrush}" NavigateUri="{x:Bind Url}"><Run FontWeight="Bold" |
131 | 142 | Text="{x:Bind Code}" Foreground="Orange" /></Hyperlink> |
132 | 143 | </TextBlock> |
133 | 144 | <TextBlock Text="{x:Bind Description}" TextWrapping="Wrap" MaxWidth="240" Foreground="White"/> |
|
148 | 159 | <ColumnDefinition Width="50"/> |
149 | 160 | </Grid.ColumnDefinitions> |
150 | 161 | <Slider |
151 | | - Padding="10, 0, 10, 0" |
152 | | - HorizontalAlignment="Stretch" |
153 | | - LargeChange="1" |
154 | | - Maximum="2.0" |
155 | | - Minimum="-2.0" |
156 | | - SmallChange="0.1" |
157 | | - StepFrequency="0.1" |
158 | | - TickFrequency="0.5" |
159 | | - TickPlacement="TopLeft" |
160 | | - Value="{x:Bind _stage.Player.PlaybackRate, Mode=TwoWay}" /> |
| 162 | + Padding="10, 0, 10, 0" |
| 163 | + HorizontalAlignment="Stretch" |
| 164 | + LargeChange="1" |
| 165 | + Maximum="2.0" |
| 166 | + Minimum="-2.0" |
| 167 | + SmallChange="0.1" |
| 168 | + StepFrequency="0.1" |
| 169 | + TickFrequency="0.5" |
| 170 | + TickPlacement="TopLeft" |
| 171 | + Value="{x:Bind _stage.Player.PlaybackRate, Mode=TwoWay}"> |
| 172 | + <Slider.Resources> |
| 173 | + <!-- |
| 174 | + Override the themed slider resources so that control ignores the accent colors. |
| 175 | + This is desirable because the accent colors may make the control hard to see |
| 176 | + on the gray background. |
| 177 | + --> |
| 178 | + <StaticResource x:Key="SliderThumbBackground" ResourceKey="LottieBasicBrush" /> |
| 179 | + <StaticResource x:Key="SliderThumbBackgroundPointerOver" ResourceKey="LottieBasicBrush" /> |
| 180 | + <StaticResource x:Key="SliderThumbBackgroundPressed" ResourceKey="LottieBasicBrush" /> |
| 181 | + <StaticResource x:Key="SliderThumbBackgroundDisabled" ResourceKey="LottieBasicBrush" /> |
| 182 | + </Slider.Resources> |
| 183 | + </Slider> |
161 | 184 | <TextBlock Grid.Column="1" Margin="10,0,0,0">x <Run Text="{x:Bind _stage.Player.PlaybackRate, Mode=OneWay, Converter={StaticResource floatFormatter}}"/></TextBlock> |
162 | 185 | </Grid> |
163 | 186 | </StackPanel> |
|
166 | 189 | <Border Style="{StaticResource SeparatorStyle}"/> |
167 | 190 |
|
168 | 191 | <!-- Properties list. Only visible if there is a Diagnostics object. --> |
169 | | - <Grid Visibility="{x:Bind _stage.DiagnosticsViewModel.DiagnosticsObject, Converter={StaticResource VisibilityConverter}, ConverterParameter=whatthe, Mode=OneWay}"> |
| 192 | + <Grid Visibility="{x:Bind _stage.DiagnosticsViewModel.DiagnosticsObject, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"> |
170 | 193 | <Grid.RowDefinitions> |
171 | 194 | <RowDefinition Height="26"/> |
172 | 195 | <RowDefinition/> |
| 196 | + <RowDefinition/> |
173 | 197 | </Grid.RowDefinitions> |
174 | 198 | <Grid.Resources> |
175 | 199 | <DataTemplate x:Key="NormalTemplate" x:DataType="viewmodel:PairOfStrings"> |
|
179 | 203 | </StackPanel> |
180 | 204 | </DataTemplate> |
181 | 205 |
|
182 | | - <DataTemplate x:Key="MarkerTemplate" x:DataType="viewmodel:Marker"> |
183 | | - <StackPanel Orientation="Horizontal" Margin="0,0,0,2"> |
184 | | - <TextBlock Foreground="LightGray" MinWidth="60" Text="{x:Bind PropertyName}"/> |
185 | | - <TextBlock Foreground="White" TextWrapping="Wrap" MaxWidth="250"> |
186 | | - <Hyperlink Click="MarkerClick"><Run Text="{x:Bind ProgressText}"/></Hyperlink> <Run Text="{x:Bind Name}"/> |
187 | | - </TextBlock> |
188 | | - </StackPanel> |
189 | | - </DataTemplate> |
190 | | - |
191 | | - <DataTemplate x:Key="MarkerWithDurationTemplate" x:DataType="viewmodel:MarkerWithDuration"> |
192 | | - <StackPanel Orientation="Horizontal" Margin="0,0,0,2"> |
193 | | - <TextBlock Foreground="LightGray" MinWidth="60" Text="{x:Bind PropertyName}"/> |
194 | | - <TextBlock Foreground="White" TextWrapping="Wrap" MaxWidth="250"> |
195 | | - <Hyperlink Click="MarkerClick"><Run Text="{x:Bind ProgressText}"/></Hyperlink> - |
196 | | - <Hyperlink Click="MarkerEndClick"><Run Text="{x:Bind ToProgressText}"/></Hyperlink> <Run Text="{x:Bind Name}"/> |
197 | | - </TextBlock> |
198 | | - </StackPanel> |
199 | | - </DataTemplate> |
200 | | - |
201 | 206 | <local:PropertiesTemplateSelector |
202 | 207 | x:Key="PropertiesTemplateSelector" |
203 | | - Normal="{StaticResource NormalTemplate}" |
204 | | - Marker="{StaticResource MarkerTemplate}" |
205 | | - MarkerWithDuration="{StaticResource MarkerWithDurationTemplate}"/> |
| 208 | + Normal="{StaticResource NormalTemplate}" /> |
206 | 209 | </Grid.Resources> |
207 | 210 | <TextBlock FontWeight="Bold" >Lottie properties</TextBlock> |
208 | | - <ItemsControl x:Name="InfoList" Grid.Row="1" ItemsSource="{x:Bind PropertiesList}" ItemTemplateSelector="{StaticResource PropertiesTemplateSelector}"/> |
| 211 | + |
| 212 | + <!-- The list of Lottie properties. --> |
| 213 | + <ItemsControl Grid.Row="1" ItemsSource="{x:Bind PropertiesList}" ItemTemplateSelector="{StaticResource PropertiesTemplateSelector}"/> |
| 214 | + |
| 215 | + <!-- Markers list. --> |
| 216 | + <Grid Grid.Row="2" Visibility="{x:Bind MarkersList.Count, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"> |
| 217 | + <Grid.Resources> |
| 218 | + <DataTemplate x:Key="MarkerTemplate" x:DataType="viewmodel:Marker"> |
| 219 | + <StackPanel Orientation="Horizontal" Margin="0,0,0,2" MaxWidth="310"> |
| 220 | + <TextBlock Foreground="White" TextAlignment="Right" TextWrapping="Wrap" MaxWidth="250" MinWidth="60" Padding="0,0,12,0"> |
| 221 | + <Hyperlink Foreground="{StaticResource LottieHyperlinkForegroundBrush}" Click="MarkerClick"><Run Text="{x:Bind InFrame}"/></Hyperlink> |
| 222 | + </TextBlock> |
| 223 | + <TextBlock Foreground="White" TextAlignment="Right" TextWrapping="Wrap" Text="{x:Bind Name}"/> |
| 224 | + </StackPanel> |
| 225 | + </DataTemplate> |
| 226 | + |
| 227 | + <DataTemplate x:Key="MarkerWithDurationTemplate" x:DataType="viewmodel:MarkerWithDuration"> |
| 228 | + <StackPanel Orientation="Horizontal" Margin="0,0,0,2" MaxWidth="310"> |
| 229 | + <TextBlock Foreground="White" TextAlignment="Right" TextWrapping="Wrap" MaxWidth="250" MinWidth="60" Padding="0,0,12,0"> |
| 230 | + <Hyperlink Foreground="{StaticResource LottieHyperlinkForegroundBrush}" Click="MarkerClick"><Run Text="{x:Bind InFrame}"/></Hyperlink> - |
| 231 | + <Hyperlink Foreground="{StaticResource LottieHyperlinkForegroundBrush}" Click="MarkerEndClick"><Run Text="{x:Bind OutFrame}"/></Hyperlink> |
| 232 | + </TextBlock> |
| 233 | + <TextBlock Foreground="White" TextWrapping="Wrap" Text="{x:Bind Name}"/> |
| 234 | + </StackPanel> |
| 235 | + </DataTemplate> |
| 236 | + |
| 237 | + <local:PropertiesTemplateSelector |
| 238 | + x:Key="PropertiesTemplateSelector" |
| 239 | + Marker="{StaticResource MarkerTemplate}" |
| 240 | + MarkerWithDuration="{StaticResource MarkerWithDurationTemplate}"/> |
| 241 | + </Grid.Resources> |
| 242 | + <StackPanel> |
| 243 | + <StackPanel Orientation="Horizontal" Margin="0,0,0,2"> |
| 244 | + <TextBlock Foreground="LightGray" MinWidth="60" Text="Markers"/> |
| 245 | + <TextBlock Foreground="White" TextWrapping="Wrap" MaxWidth="250" /> |
| 246 | + </StackPanel> |
| 247 | + <!--<StackPanel Orientation="Horizontal" Margin="0,0,0,2"> |
| 248 | + <TextBlock Foreground="DimGray" MinWidth="60" Text="Frame" TextAlignment="Right"/> |
| 249 | + <TextBlock Foreground="DimGray" Text="Name" Margin="10,0,0,0"/> |
| 250 | + </StackPanel>--> |
| 251 | + <ItemsControl ItemsSource="{x:Bind MarkersList}" ItemTemplateSelector="{StaticResource PropertiesTemplateSelector}"/> |
| 252 | + </StackPanel> |
| 253 | + </Grid> |
209 | 254 | </Grid> |
210 | 255 |
|
211 | 256 | <!-- Separator --> |
212 | 257 | <Border Style="{StaticResource SeparatorStyle}" |
213 | | - Visibility="{x:Bind _stage.DiagnosticsViewModel.DiagnosticsObject, Converter={StaticResource VisibilityConverter}, ConverterParameter=whatthe, Mode=OneWay}"/> |
| 258 | + Visibility="{x:Bind _stage.DiagnosticsViewModel.DiagnosticsObject, Converter={StaticResource VisibilityConverter}, Mode=OneWay}"/> |
214 | 259 |
|
215 | 260 | <!-- App version info. --> |
216 | 261 | <Grid> |
|
293 | 338 |
|
294 | 339 | <!-- Play/stop button --> |
295 | 340 | <local:PlayStopButton |
296 | | - Margin="0,4,0,0" |
297 | 341 | x:Name="_playStopButton" |
| 342 | + Margin="0,4,0,0" |
298 | 343 | IsEnabled="{x:Bind _stage.Player.IsAnimatedVisualLoaded, Mode=OneWay}" |
299 | 344 | Toggled="_playControl_Toggled" |
300 | 345 | VerticalAlignment="Center" |
|
305 | 350 | /> |
306 | 351 |
|
307 | 352 | <!-- Scrubber --> |
308 | | - <!-- IsEnabled="{x:Bind _playStopButton.IsChecked, Mode=OneWay}" --> |
309 | | - <local:Scrubber x:Name="_scrubber" |
310 | | - AutomationProperties.Name="Animation progress" |
311 | | - Margin="0,5,0,0" |
312 | | - VerticalAlignment="Center" |
313 | | - IsEnabled="{x:Bind _stage.Player.IsAnimatedVisualLoaded, Mode=OneWay}" |
314 | | - RelativePanel.AlignBottomWithPanel="True" |
315 | | - RelativePanel.AlignRightWithPanel="True" |
316 | | - RelativePanel.AlignTopWithPanel="True" |
317 | | - RelativePanel.RightOf="_playStopButton" |
318 | | - ValueChanged="ProgressSliderChanged" |
319 | | - DiagnosticsViewModel="{x:Bind _stage.DiagnosticsViewModel, Mode=OneWay}" /> |
| 353 | + <local:Scrubber |
| 354 | + x:Name="_scrubber" |
| 355 | + AutomationProperties.Name="Animation progress" |
| 356 | + Margin="0,5,0,0" |
| 357 | + VerticalAlignment="Center" |
| 358 | + IsEnabled="{x:Bind _stage.Player.IsAnimatedVisualLoaded, Mode=OneWay}" |
| 359 | + RelativePanel.AlignBottomWithPanel="True" |
| 360 | + RelativePanel.AlignTopWithPanel="True" |
| 361 | + RelativePanel.RightOf="_playStopButton" |
| 362 | + RelativePanel.AlignRightWithPanel="True" |
| 363 | + ValueChanged="ProgressSliderChanged" |
| 364 | + DiagnosticsViewModel="{x:Bind _stage.DiagnosticsViewModel, Mode=OneWay}" /> |
320 | 365 | </RelativePanel> |
321 | 366 | </Grid> |
322 | 367 | </RelativePanel> |
|
0 commit comments