From 62a3220f7ffe898d24dcb2f93301bedd2afbd9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Mon, 4 Oct 2021 20:01:50 +0200 Subject: [PATCH] Share current song by double click --- Views/MainWindow.xaml | 2 +- Views/MainWindow.xaml.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Views/MainWindow.xaml b/Views/MainWindow.xaml index 87e8e15..8b409a2 100644 --- a/Views/MainWindow.xaml +++ b/Views/MainWindow.xaml @@ -28,7 +28,7 @@ - + diff --git a/Views/MainWindow.xaml.cs b/Views/MainWindow.xaml.cs index e9004fe..45449d9 100644 --- a/Views/MainWindow.xaml.cs +++ b/Views/MainWindow.xaml.cs @@ -266,6 +266,17 @@ namespace unison hk.Activate(this); } + private void MouseDownClipboard(object sender, MouseButtonEventArgs e) + { + if (e.ClickCount == 2) + { + string CopyText = SongTitle.Text + " - " + SongArtist.Text + "\n"; + CopyText += SongAlbum.Text + "\n"; + CopyText += SongTitle.ToolTip; + Clipboard.SetText(CopyText); + } + } + public void InitHwnd() { WindowInteropHelper helper = new(this);