From 182c7b1692a552c55ad420c61b9e3379d9922df6 Mon Sep 17 00:00:00 2001
From: zznty <94796179+zznty@users.noreply.github.com>
Date: Fri, 18 Oct 2024 02:52:44 +0700
Subject: [PATCH] add share track button
---
MusicX.Shared/Player/PlaylistTrack.cs | 1 +
MusicX/Controls/TrackControl.xaml | 8 ++
MusicX/Controls/TrackControl.xaml.cs | 7 ++
MusicX/Helpers/EmbeddedFileStreamReference.cs | 66 ++++++++++++
MusicX/Helpers/IDataTransferManagerInterop.cs | 25 +++++
MusicX/MusicX.csproj | 2 +
MusicX/RootWindow.xaml.cs | 4 +
MusicX/Services/DownloaderService.cs | 75 +++++++-------
MusicX/Services/ShareService.cs | 95 ++++++++++++++++++
MusicX/StoreLogo.scale-30.png | Bin 0 -> 747 bytes
MusicX/ViewModels/DownloaderViewModel.cs | 2 +-
MusicX/Views/StartingWindow.xaml.cs | 1 +
12 files changed, 251 insertions(+), 35 deletions(-)
create mode 100644 MusicX/Helpers/EmbeddedFileStreamReference.cs
create mode 100644 MusicX/Helpers/IDataTransferManagerInterop.cs
create mode 100644 MusicX/Services/ShareService.cs
create mode 100644 MusicX/StoreLogo.scale-30.png
diff --git a/MusicX.Shared/Player/PlaylistTrack.cs b/MusicX.Shared/Player/PlaylistTrack.cs
index bbbd4bef..6dc95007 100644
--- a/MusicX.Shared/Player/PlaylistTrack.cs
+++ b/MusicX.Shared/Player/PlaylistTrack.cs
@@ -41,6 +41,7 @@ public sealed record BoomTrackData(string Url, bool IsLiked, bool IsExplicit, Ti
public record IdInfo(long Id, long OwnerId, string AccessKey)
{
public string ToOwnerIdString() => $"{OwnerId}_{Id}";
+ public override string ToString() => $"{OwnerId}_{Id}_{AccessKey}";
}
[ProtoContract(ImplicitFields = ImplicitFields.AllPublic, SkipConstructor = true)]
diff --git a/MusicX/Controls/TrackControl.xaml b/MusicX/Controls/TrackControl.xaml
index 65ce2d7a..8f317a16 100644
--- a/MusicX/Controls/TrackControl.xaml
+++ b/MusicX/Controls/TrackControl.xaml
@@ -29,6 +29,14 @@
Margin="10,0,0,0"
/>
+
+
+
+
+