FullScreenWindow.xaml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <UserControl
  2. x:Class="PDF_Master.Views.Dialog.FullScreenWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:dialog="clr-namespace:PDF_Master.ViewModels.Dialog"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:local="clr-namespace:PDF_Master.Views.Dialog"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:prism="http://prismlibrary.com/"
  12. MinWidth="800"
  13. MinHeight="450"
  14. d:DataContext="{d:DesignInstance Type=dialog:FullScreenWindowViewModel}"
  15. prism:ViewModelLocator.AutoWireViewModel="True"
  16. mc:Ignorable="d">
  17. <prism:Dialog.WindowStyle>
  18. <Style TargetType="{x:Type Window}">
  19. <Setter Property="Title" Value="{Binding Title}" />
  20. <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" />
  21. <Setter Property="ShowInTaskbar" Value="False" />
  22. <Setter Property="WindowState" Value="Maximized" />
  23. <Setter Property="WindowStyle" Value="None" />
  24. </Style>
  25. </prism:Dialog.WindowStyle>
  26. <UserControl.InputBindings>
  27. <KeyBinding Key="Esc" Command="{Binding ExitCommand}" />
  28. </UserControl.InputBindings>
  29. <Grid Name="GridRoot">
  30. <ContentControl prism:RegionManager.RegionName="{Binding RegionName}" />
  31. <Grid
  32. Name="GridTip"
  33. Height="32"
  34. VerticalAlignment="Top"
  35. Cursor="Hand">
  36. <TextBlock
  37. x:Name="PressEscTip"
  38. Padding="0,8,0,0"
  39. Background="#99000000"
  40. Foreground="#FFFFFFFF"
  41. Text="Press Esc to exit Full Screen"
  42. TextAlignment="Center" />
  43. <Button
  44. Name="BtnHideTip"
  45. Width="16"
  46. Height="16"
  47. Margin="0,0,12,0"
  48. HorizontalAlignment="Right">
  49. <Polygon Fill="#FFDBDDE5" Points="11.2919922 12 12 11.2919922 6.70800781 6 12 0.708007813 11.2919922 0 6 5.29199219 0.708007812 9.76996262e-15 -2.27456942e-13 0.708007813 5.29199219 6 0 11.2919922 0.708007812 12 6 6.70800781" />
  50. <Button.Triggers>
  51. <!-- 按钮点击后顶部栏消失 -->
  52. <EventTrigger RoutedEvent="Button.Click">
  53. <EventTrigger.Actions>
  54. <BeginStoryboard>
  55. <Storyboard>
  56. <ObjectAnimationUsingKeyFrames
  57. BeginTime="00:00:00"
  58. Storyboard.TargetName="GridTip"
  59. Storyboard.TargetProperty="(UIElement.Visibility)">
  60. <DiscreteObjectKeyFrame KeyTime="00:00:0.1" Value="{x:Static Visibility.Collapsed}" />
  61. </ObjectAnimationUsingKeyFrames>
  62. </Storyboard>
  63. </BeginStoryboard>
  64. </EventTrigger.Actions>
  65. </EventTrigger>
  66. </Button.Triggers>
  67. </Button>
  68. <!-- 通过动画设置顶部栏15秒后消失 -->
  69. <Grid.Triggers>
  70. <EventTrigger RoutedEvent="Loaded">
  71. <EventTrigger.Actions>
  72. <BeginStoryboard>
  73. <Storyboard>
  74. <ObjectAnimationUsingKeyFrames
  75. BeginTime="00:00:00"
  76. Storyboard.TargetName="GridTip"
  77. Storyboard.TargetProperty="(UIElement.Visibility)">
  78. <DiscreteObjectKeyFrame KeyTime="00:00:15" Value="{x:Static Visibility.Collapsed}" />
  79. </ObjectAnimationUsingKeyFrames>
  80. </Storyboard>
  81. </BeginStoryboard>
  82. </EventTrigger.Actions>
  83. </EventTrigger>
  84. </Grid.Triggers>
  85. </Grid>
  86. <cus:ToastControl
  87. Width="auto"
  88. Height="auto"
  89. Margin="0,0,0,300"
  90. VerticalAlignment="Bottom"
  91. Background="#89000000"
  92. BeginTime="0:0:0:3"
  93. CornerRadius="4"
  94. FontSize="14"
  95. Foreground="White"
  96. StringContent="Press Esc To Exit Full Mode"
  97. Visibility="{Binding ShowTip}"
  98. Duration="0:0:0:3" />
  99. <i:Interaction.Triggers>
  100. <i:EventTrigger EventName="Loaded">
  101. <i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=GridRoot}" />
  102. </i:EventTrigger>
  103. </i:Interaction.Triggers>
  104. </Grid>
  105. </UserControl>