Enable window dragging in video viewer panel #425

This commit is contained in:
ema
2025-06-27 02:38:17 +08:00
parent aef35d748e
commit d858840183
2 changed files with 9 additions and 1 deletions

View File

@@ -20,7 +20,7 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid MouseLeftButtonDown="Panel_MouseLeftButtonDown">
<mediakit:MediaUriElement x:Name="mediaElement" />
<Grid x:Name="coverArtPersenter"
Background="{StaticResource MainWindowBackground}"

View File

@@ -181,6 +181,14 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
_midiPlayer = null;
}
private void Panel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
Window.GetWindow(this)?.DragMove();
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void MediaOpened(object o, RoutedEventArgs args)