ModalWindow.xaml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <controls:BaseModalWindow x:Class="MediaBrowser.UI.Controls.ModalWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:MediaBrowser.UI.Controls"
  4. xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
  5. Title="ModalWindow"
  6. AllowsTransparency="True"
  7. Background="Transparent"
  8. Style="{StaticResource ModalWindow}">
  9. <Grid>
  10. <Grid Style="{StaticResource ModalOverlayStyle}">
  11. </Grid>
  12. <Grid Style="{StaticResource ModalContentStyle}" RenderTransformOrigin="1,0">
  13. <Grid Style="{StaticResource ModalContentInnerStyle}">
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="auto"></ColumnDefinition>
  16. <ColumnDefinition Width="*"></ColumnDefinition>
  17. </Grid.ColumnDefinitions>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="auto"></RowDefinition>
  20. <RowDefinition Height="auto"></RowDefinition>
  21. <RowDefinition Height="auto"></RowDefinition>
  22. </Grid.RowDefinitions>
  23. <Image Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Style="{StaticResource ModalButtonImage}"></Image>
  24. <TextBlock x:Name="txtCaption" Text="{Binding Caption}" Style="{StaticResource Heading2TextBlockStyle}" Grid.Row="0" Grid.Column="1" Margin="0 30 0 10"></TextBlock>
  25. <Grid x:Name="pnlContent" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="1">
  26. </Grid>
  27. <StackPanel x:Name="pnlButtons" Style="{StaticResource ModalButtonPanel}" Grid.Row="2" Grid.Column="1">
  28. <controls:ExtendedButton x:Name="btnYes" Content="Yes" Style="{StaticResource ModalButton}"></controls:ExtendedButton>
  29. <controls:ExtendedButton x:Name="btnNo" Content="No" Style="{StaticResource ModalButton}"></controls:ExtendedButton>
  30. <controls:ExtendedButton x:Name="btnOk" Content="OK" Style="{StaticResource ModalButton}"></controls:ExtendedButton>
  31. <controls:ExtendedButton x:Name="btnCancel" Content="Cancel" Style="{StaticResource ModalButton}"></controls:ExtendedButton>
  32. </StackPanel>
  33. </Grid>
  34. <!-- Animation -->
  35. <Grid.Triggers>
  36. <EventTrigger RoutedEvent="FrameworkElement.Loaded">
  37. <BeginStoryboard>
  38. <Storyboard>
  39. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
  40. <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
  41. <SplineDoubleKeyFrame KeyTime="0:0:0.15" Value="1"/>
  42. </DoubleAnimationUsingKeyFrames>
  43. </Storyboard>
  44. </BeginStoryboard>
  45. </EventTrigger>
  46. </Grid.Triggers>
  47. <Grid.RenderTransform>
  48. <ScaleTransform ScaleX="1" />
  49. </Grid.RenderTransform>
  50. </Grid>
  51. <Grid.LayoutTransform>
  52. <ScaleTransform ScaleX="{Binding Path=ContentScale}" ScaleY="{Binding Path=ContentScale}" CenterX="0" CenterY="0" />
  53. </Grid.LayoutTransform>
  54. </Grid>
  55. </controls:BaseModalWindow>