From b09526688cf266a0765cd89fde4c94d3bab1b404 Mon Sep 17 00:00:00 2001 From: Heikki Hyttinen Date: Thu, 9 May 2024 18:48:14 +0300 Subject: [PATCH] Added PointerEntered/Exited event handlers to sample --- .../Views/VideoPlayer.axaml | 6 ++++-- .../Views/VideoPlayer.axaml.cs | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml b/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml index 4f252cc4..e9fe754c 100644 --- a/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml +++ b/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml @@ -17,8 +17,10 @@ - + VerticalAlignment="Stretch" + PointerEntered="VideoViewOnPointerEntered" + PointerExited="VideoViewOnPointerExited"> + diff --git a/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml.cs b/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml.cs index 9f203f03..c08789be 100644 --- a/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml.cs +++ b/samples/LibVLCSharp.Avalonia.Sample/Views/VideoPlayer.axaml.cs @@ -1,5 +1,6 @@ using System; using Avalonia.Controls; +using Avalonia.Input; using LibVLCSharp.Avalonia.Sample.ViewModels; namespace LibVLCSharp.Avalonia.Sample.Views @@ -18,5 +19,15 @@ private void OnDataContextChanged(object sender, EventArgs e) vm.Play(); } } + + private void VideoViewOnPointerEntered(object sender, PointerEventArgs e) + { + ControlsPanel.IsVisible = true; + } + + private void VideoViewOnPointerExited(object sender, PointerEventArgs e) + { + ControlsPanel.IsVisible = false; + } } } \ No newline at end of file