FullScreenWindow.xaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. Visibility="Collapsed">
  37. <TextBlock
  38. x:Name="PressEscTip"
  39. Padding="0,8,0,0"
  40. Background="#99000000"
  41. Foreground="#FFFFFFFF"
  42. Text="Press Esc to exit Full Screen"
  43. TextAlignment="Center" />
  44. <Button
  45. Name="BtnHideTip"
  46. Width="16"
  47. Height="16"
  48. Margin="0,0,12,0"
  49. HorizontalAlignment="Right">
  50. <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" />
  51. <Button.Triggers>
  52. <!-- 按钮点击后顶部栏消失 -->
  53. <EventTrigger RoutedEvent="Button.Click">
  54. <EventTrigger.Actions>
  55. <BeginStoryboard>
  56. <Storyboard>
  57. <ObjectAnimationUsingKeyFrames
  58. BeginTime="00:00:00"
  59. Storyboard.TargetName="GridTip"
  60. Storyboard.TargetProperty="(UIElement.Visibility)">
  61. <DiscreteObjectKeyFrame KeyTime="00:00:0.1" Value="{x:Static Visibility.Collapsed}" />
  62. </ObjectAnimationUsingKeyFrames>
  63. </Storyboard>
  64. </BeginStoryboard>
  65. </EventTrigger.Actions>
  66. </EventTrigger>
  67. </Button.Triggers>
  68. </Button>
  69. <!-- 通过动画设置顶部栏15秒后消失 -->
  70. <Grid.Triggers>
  71. <EventTrigger RoutedEvent="Loaded">
  72. <EventTrigger.Actions>
  73. <BeginStoryboard>
  74. <Storyboard>
  75. <ObjectAnimationUsingKeyFrames
  76. BeginTime="00:00:00"
  77. Storyboard.TargetName="GridTip"
  78. Storyboard.TargetProperty="(UIElement.Visibility)">
  79. <DiscreteObjectKeyFrame KeyTime="00:00:15" Value="{x:Static Visibility.Collapsed}" />
  80. </ObjectAnimationUsingKeyFrames>
  81. </Storyboard>
  82. </BeginStoryboard>
  83. </EventTrigger.Actions>
  84. </EventTrigger>
  85. </Grid.Triggers>
  86. </Grid>
  87. <cus:ToastControl
  88. Width="auto"
  89. Height="auto "
  90. Margin="0,16,0,0"
  91. Padding="16,9"
  92. VerticalAlignment="Top"
  93. Background="{StaticResource color.sys.layout.dark.bg}"
  94. BeginTime="0:0:0:3"
  95. CornerRadius="4"
  96. FontSize="14"
  97. Foreground="White"
  98. StringContent="Press esc to exit full screen mode"
  99. Visibility="{Binding ShowTip}"
  100. Duration="0:0:0:3" />
  101. <i:Interaction.Triggers>
  102. <i:EventTrigger EventName="Loaded">
  103. <i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=GridRoot}" />
  104. </i:EventTrigger>
  105. </i:Interaction.Triggers>
  106. </Grid>
  107. </UserControl>