Guest User

Untitled

a guest
Feb 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public sealed partial class VideoPlay : Page
  2. {
  3. public VideoPlay()
  4. {
  5. this.InitializeComponent();
  6. }
  7.  
  8.  
  9. private async void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args)
  10. {
  11. if (args.VirtualKey == Windows.System.VirtualKey.GamepadDPadDown || args.VirtualKey == Windows.System.VirtualKey.GamepadLeftThumbstickDown)
  12. {
  13. VideoMenuGrid.Visibility = Visibility.Visible;
  14. await VideoMenuGrid.Offset(200f, 0f, 1000, 0).StartAsync();
  15. }
  16. else if (args.VirtualKey == Windows.System.VirtualKey.GamepadDPadUp || args.VirtualKey == Windows.System.VirtualKey.GamepadLeftThumbstickUp)
  17. {
  18. await VideoMenuGrid.Offset(0f, 0f, 1000, 0).StartAsync();
  19. VideoMenuGrid.Visibility = Visibility.Collapsed;
  20. }
  21. }
  22.  
  23. protected override void OnNavigatedTo(NavigationEventArgs e)
  24. {
  25. base.OnNavigatedTo(e);
  26. Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
  27. }
  28. protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
  29. {
  30. base.OnNavigatingFrom(e);
  31. Window.Current.CoreWindow.KeyDown -= CoreWindow_KeyDown;
  32. }
  33.  
  34. }
  35.  
  36. <Grid >
  37. <Grid HorizontalAlignment="Stretch"
  38. Height="200"
  39. x:Name="VideoMenuGrid"
  40. Margin="0,-200,0,0"
  41. VerticalAlignment="Top">
  42. <Grid.Background>
  43. <SolidColorBrush Color="Yellow" Opacity="0.5"/>
  44. </Grid.Background>
  45. </Grid>
  46. </Grid>
Add Comment
Please, Sign In to add comment