├── .vs
├── AduMusic
│ └── v15
│ │ └── .suo
├── ProjectSettings.json
├── VSWorkspaceState.json
└── slnx.sqlite
├── AduMusic
├── .vs
│ └── AduMusic
│ │ └── v15
│ │ ├── .suo
│ │ └── Server
│ │ └── sqlite3
│ │ ├── db.lock
│ │ ├── storage.ide
│ │ ├── storage.ide-shm
│ │ └── storage.ide-wal
├── AduMusic.sln
├── AduMusic.v12.suo
└── AduMusic
│ ├── 128.ico
│ ├── API
│ └── PrivateMethod.cs
│ ├── AduMusic.csproj
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Common
│ ├── AsynchUtils.cs
│ ├── CvUtils.cs
│ └── FolderHelper.cs
│ ├── Controls
│ └── ImageRadioButton.cs
│ ├── Fonts
│ └── iconfont.ttf
│ ├── Images
│ ├── Background
│ │ ├── Sys.png
│ │ └── f3.jpg
│ ├── ICON
│ │ ├── 128.ico
│ │ └── 48.ico
│ └── Nor
│ │ ├── Cover.png
│ │ └── NorHeader.jpg
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── MiniWindow.xaml
│ ├── MiniWindow.xaml.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── Styles
│ ├── Carousel
│ │ ├── Carousel2DView.xaml
│ │ ├── Carousel2DView.xaml.cs
│ │ ├── ImageItem.xaml
│ │ ├── ImageItem.xaml.cs
│ │ └── InteractivePanel3D.cs
│ ├── DataGrid.xaml
│ ├── DataGridForSong.xaml
│ ├── Expander.xaml
│ ├── FormControl.xaml
│ ├── ItemControlTemp.xaml
│ ├── ListBox.xaml
│ ├── ListView.xaml
│ ├── Login.xaml
│ ├── Menu.xaml
│ ├── NorTheme.xaml
│ ├── RadioButton.xaml
│ ├── ScrollView.xaml
│ ├── SelectDate.xaml
│ ├── Style.xaml
│ ├── TabControl.xaml
│ ├── TabControl_Friend.xaml
│ ├── TabControl_Home.xaml
│ ├── WButton.xaml
│ ├── WSSlider.xaml
│ └── WSlider.xaml
│ ├── UserLogin.xaml
│ ├── UserLogin.xaml.cs
│ ├── Views
│ ├── Home.xaml
│ ├── Home.xaml.cs
│ ├── MusicList.xaml
│ └── MusicList.xaml.cs
│ └── bin
│ └── DLLs
│ └── 3DTools.dll
├── README.md
└── ScreenShot
├── Cover (1).png
└── Cover (2).png
/.vs/AduMusic/v15/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/.vs/AduMusic/v15/.suo
--------------------------------------------------------------------------------
/.vs/ProjectSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "CurrentProjectSetting": null
3 | }
--------------------------------------------------------------------------------
/.vs/VSWorkspaceState.json:
--------------------------------------------------------------------------------
1 | {
2 | "ExpandedNodes": [
3 | "",
4 | "\\AduMusic",
5 | "\\AduMusic\\AduMusic",
6 | "\\AduMusic\\AduMusic\\obj",
7 | "\\AduMusic\\AduMusic\\obj\\Debug"
8 | ],
9 | "SelectedNode": "\\AduMusic\\AduMusic.sln",
10 | "PreviewInSolutionExplorer": false
11 | }
--------------------------------------------------------------------------------
/.vs/slnx.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/.vs/slnx.sqlite
--------------------------------------------------------------------------------
/AduMusic/.vs/AduMusic/v15/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/.suo
--------------------------------------------------------------------------------
/AduMusic/.vs/AduMusic/v15/Server/sqlite3/db.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/db.lock
--------------------------------------------------------------------------------
/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide
--------------------------------------------------------------------------------
/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-shm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-shm
--------------------------------------------------------------------------------
/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-wal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-wal
--------------------------------------------------------------------------------
/AduMusic/AduMusic.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AduMusic", "AduMusic\AduMusic.csproj", "{567C5328-B5ED-48B6-88EC-AC91FF5C924D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic.v12.suo
--------------------------------------------------------------------------------
/AduMusic/AduMusic/128.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/128.ico
--------------------------------------------------------------------------------
/AduMusic/AduMusic/API/PrivateMethod.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.Drawing.Imaging;
7 | using System.Linq;
8 | using System.Net;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Controls;
13 | using System.Windows.Interop;
14 | using System.Windows.Media.Imaging;
15 |
16 | namespace AduMusic.API
17 | {
18 | public static class PrivateMethod
19 | {
20 | public static BitmapSource GetImage(string url)
21 | {
22 | return ChangeBitmapToBitmapSource(GetNetImage(url));
23 | }
24 | //根据网络获取一张图片
25 | public static System.Drawing.Bitmap GetNetImage(string url)
26 | {
27 | System.Drawing.Image Logo = null;
28 | System.Net.WebClient wb = new System.Net.WebClient();
29 | Stream stream = wb.OpenRead(url);
30 | //网址自己改吧
31 | Logo = System.Drawing.Image.FromStream(stream);
32 | stream.Dispose(); stream.Close(); wb.Dispose();
33 | return (System.Drawing.Bitmap)Logo;
34 | }
35 | ///
36 | /// 下载网络图片到本地
37 | ///
38 | /// 网络路径
39 | /// 文件夹名
40 | ///
41 | public static void DownNetImage(string url)
42 | {
43 | string fname = Path.GetFileName(url);
44 | string DirectoryPath = Environment.CurrentDirectory + "\\FMBackground\\";
45 | string fileName = DirectoryPath + "xinli" + fname;
46 | if (!Directory.Exists(DirectoryPath))
47 | {
48 | Directory.CreateDirectory(DirectoryPath);
49 | }
50 | if (!File.Exists(fileName))
51 | {
52 | System.Net.WebClient wb = new System.Net.WebClient();
53 | Stream stream = wb.OpenRead(url);
54 | //网址自己改吧
55 | System.Drawing.Image Logo = System.Drawing.Image.FromStream(stream);
56 | stream.Dispose(); wb.Dispose();
57 | Logo.Save(fileName);
58 | }
59 | }
60 | //根据获取一张本地图片
61 | public static System.Drawing.Bitmap GetLocalImage(string url)
62 | {
63 | return null;
64 | }
65 |
66 |
67 | public static BitmapSource ChangeBitmapToBitmapSource(Bitmap bmp)
68 | {
69 | BitmapSource returnSource=null;
70 | App.DispatcherHelper.Invoke(new Action(() =>
71 | {
72 | try
73 | {
74 | returnSource = Imaging.CreateBitmapSourceFromHBitmap(bmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
75 | }
76 | catch
77 | {
78 | }
79 | }));
80 | return returnSource;
81 | }
82 |
83 | ///
84 | /// 下图片。缓存
85 | ///
86 | ///
87 | ///
88 | ///
89 | //public static void DownImage(string name, string path, Action action)
90 | //{
91 | // Task.Factory.StartNew(() => {
92 | // string DirectoryPath = HTTP.RunPath + "images\\";
93 | // string ImagePath = HTTP.RunPath + "images\\" + name;
94 |
95 | // if (!Directory.Exists(DirectoryPath))
96 | // {
97 | // Directory.CreateDirectory(DirectoryPath);
98 | // }
99 | // if (!File.Exists(ImagePath))
100 | // {
101 | // using (WebClient wb = new WebClient())
102 | // {
103 | // wb.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
104 | // wb.Headers.Add("Accept-Encoding", "gzip, deflate, sdch");
105 | // wb.Headers.Add("Cache-Control", "max-age=0");
106 | // wb.Headers.Add("If-None-Match", "59cfaaac-56af");
107 | // wb.Headers.Add("Host", "i.meizitu.net");
108 | // wb.Headers.Add("Referer", "http://www.mzitu.com/");
109 | // wb.DownloadFile(path, ImagePath);
110 | // }
111 | // }
112 | // action(ImagePath);
113 | // });
114 | //}
115 |
116 | public static void DownImage(string DirectoryName, string Url)
117 | {
118 | //Task.Factory.StartNew(() => {
119 | //存储路径
120 | string DirectoryPath = System.Environment.CurrentDirectory + "\\FMBackground" + DirectoryName;
121 |
122 | if (!Directory.Exists(DirectoryPath))
123 | {
124 | Directory.CreateDirectory(DirectoryPath);
125 | }
126 | if (!File.Exists(DirectoryPath))
127 | {
128 | using (WebClient wb = new WebClient())
129 | {
130 | wb.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
131 | wb.Headers.Add("Accept-Encoding", "gzip, deflate");
132 | wb.Headers.Add("Cache-Control", "max-age=0");
133 | wb.Headers.Add("If-None-Match", "53675C2E11C46B5C2AE17B5CC79E4D7F");
134 |
135 | wb.Headers.Add("If-Modified-Since", "Mon, 15 Aug 2016 10:11:21 GMT");
136 | wb.Headers.Add("Upgrade-Insecure-Requests", "1");
137 |
138 | wb.Headers.Add("Host", "image.xinli001.com");
139 | wb.Headers.Add("Connection", "keep-alive");
140 | wb.Headers.Add("User-Agent", "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Mobile Safari/537.36");
141 | wb.Headers.Add("Referer", "http://fm.xinli001.com/");
142 | wb.DownloadFile(Url, DirectoryPath);
143 | }
144 | }
145 | //});
146 | }
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/AduMusic.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}
8 | WinExe
9 | Properties
10 | AduMusic
11 | AduMusic
12 | v4.5
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 | 128.ico
38 |
39 |
40 |
41 | False
42 | bin\DLLs\3DTools.dll
43 |
44 |
45 | False
46 | bin\Debug\Newtonsoft.Json.dll
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 4.0
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | MSBuild:Compile
67 | Designer
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | MiniWindow.xaml
76 |
77 |
78 | Carousel2DView.xaml
79 |
80 |
81 | ImageItem.xaml
82 |
83 |
84 |
85 | UserLogin.xaml
86 |
87 |
88 | Home.xaml
89 |
90 |
91 | MusicList.xaml
92 |
93 |
94 | MSBuild:Compile
95 | Designer
96 |
97 |
98 | App.xaml
99 | Code
100 |
101 |
102 | MainWindow.xaml
103 | Code
104 |
105 |
106 | Designer
107 | MSBuild:Compile
108 |
109 |
110 | MSBuild:Compile
111 | Designer
112 |
113 |
114 | MSBuild:Compile
115 | Designer
116 |
117 |
118 | MSBuild:Compile
119 | Designer
120 |
121 |
122 | Designer
123 | MSBuild:Compile
124 |
125 |
126 | MSBuild:Compile
127 | Designer
128 |
129 |
130 | MSBuild:Compile
131 | Designer
132 |
133 |
134 | MSBuild:Compile
135 | Designer
136 |
137 |
138 | MSBuild:Compile
139 | Designer
140 |
141 |
142 | Designer
143 | MSBuild:Compile
144 |
145 |
146 | MSBuild:Compile
147 | Designer
148 |
149 |
150 | MSBuild:Compile
151 | Designer
152 |
153 |
154 | Designer
155 | MSBuild:Compile
156 |
157 |
158 | MSBuild:Compile
159 | Designer
160 |
161 |
162 | MSBuild:Compile
163 | Designer
164 |
165 |
166 | MSBuild:Compile
167 | Designer
168 |
169 |
170 | MSBuild:Compile
171 | Designer
172 |
173 |
174 | MSBuild:Compile
175 | Designer
176 |
177 |
178 | MSBuild:Compile
179 | Designer
180 |
181 |
182 | MSBuild:Compile
183 | Designer
184 |
185 |
186 | MSBuild:Compile
187 | Designer
188 |
189 |
190 | MSBuild:Compile
191 | Designer
192 |
193 |
194 | Designer
195 | MSBuild:Compile
196 |
197 |
198 | Designer
199 | MSBuild:Compile
200 |
201 |
202 | Designer
203 | MSBuild:Compile
204 |
205 |
206 | Designer
207 | MSBuild:Compile
208 |
209 |
210 |
211 |
212 | Code
213 |
214 |
215 | True
216 | True
217 | Resources.resx
218 |
219 |
220 | True
221 | Settings.settings
222 | True
223 |
224 |
225 | ResXFileCodeGenerator
226 | Resources.Designer.cs
227 |
228 |
229 |
230 | SettingsSingleFileGenerator
231 | Settings.Designer.cs
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
263 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Threading;
9 |
10 | namespace AduMusic
11 | {
12 | ///
13 | /// App.xaml 的交互逻辑
14 | ///
15 | public partial class App : Application
16 | {
17 | public static Dispatcher DispatcherHelper;
18 | public static MainWindow APP;
19 | protected override void OnStartup(StartupEventArgs e)
20 | {
21 | MainWindow = APP;
22 | APP = new MainWindow();
23 | DispatcherHelper = APP.Dispatcher;
24 | //APP.Show();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Common/AsynchUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | using System.Windows.Threading;
8 |
9 | namespace AduMusic.Common
10 | {
11 | public class AsynchUtils
12 | {
13 | public delegate void AsynchWorkDelegate();
14 | public delegate void AsynchWorkCompleteDelegate(object obj);
15 |
16 | private const int ThreadCount = 8;
17 | private static Thread[] WorkThreads; // 线程组
18 | private static LinkedList[] ThreadWorkerQueues; // 线程
19 |
20 | static AsynchUtils()
21 | {
22 | // 创建线程
23 | WorkThreads = new Thread[ThreadCount];
24 | ThreadWorkerQueues = new LinkedList[ThreadCount];
25 |
26 | // 创建链表(链表数与线程数相同)
27 | for (int i = 0; i < WorkThreads.Length; i++)
28 | {
29 | WorkThreads[i] = new Thread(new ParameterizedThreadStart(AsynchWorker));
30 | WorkThreads[i].Name = "Worker Thread: " + i;
31 | ThreadWorkerQueues[i] = new LinkedList();
32 | WorkThreads[i].Start(ThreadWorkerQueues[i]);
33 | }
34 | }
35 |
36 | public static void Dispose()
37 | {
38 | try
39 | {
40 | if (WorkThreads != null && WorkThreads.Length > 0)
41 | {
42 | for (int i = 0; i < WorkThreads.Length; i++)
43 | {
44 | if (WorkThreads[i] != null)
45 | WorkThreads[i].Abort();
46 | }
47 |
48 | WorkThreads = null;
49 | ThreadWorkerQueues = null;
50 | }
51 | }
52 | catch { }
53 | }
54 |
55 | // 线程从链表获取需要执行的事件或方法并执行处理
56 | internal static void AsynchWorker(object oLinkedList)
57 | {
58 | var workQueue = (LinkedList)oLinkedList;
59 | while (true)
60 | {
61 | try
62 | {
63 | AsynchWorkDelegate delegateToExecute = null;
64 | Monitor.Enter(workQueue);
65 | {
66 | if (workQueue.Count == 0)
67 | Monitor.Wait(workQueue);
68 | delegateToExecute = workQueue.First.Value;
69 | workQueue.RemoveFirst();
70 | }
71 | Monitor.Exit(workQueue);
72 |
73 | Thread.Sleep(10);
74 |
75 | if (delegateToExecute != null)
76 | delegateToExecute();
77 | }
78 | catch
79 | {
80 | break;
81 | }
82 | }
83 | }
84 |
85 | private static void AddToWorkQueue(AsynchWorkDelegate work)
86 | {
87 | try
88 | {
89 | int min = int.MaxValue;
90 | LinkedList minQueue = null;
91 |
92 | // 获取所有链表中,挂载需要执行方法最少的链表和线程
93 | for (int i = 0; i < ThreadWorkerQueues.Length; i++)
94 | {
95 | if (min > ThreadWorkerQueues[i].Count)
96 | {
97 | min = ThreadWorkerQueues[i].Count;
98 | minQueue = ThreadWorkerQueues[i];
99 | }
100 | }
101 |
102 | // 挂载方法或事件
103 | if (work != null)
104 | {
105 | Monitor.Enter(minQueue);
106 | {
107 | minQueue.AddLast(work);
108 | Monitor.Pulse(minQueue);
109 | }
110 | Monitor.Exit(minQueue);
111 | }
112 | }
113 | catch { }
114 | }
115 |
116 | public static void AsynchExecuteFunc(Dispatcher oDispatcher, AsynchWorkDelegate oEvent)
117 | {
118 | AddToWorkQueue(delegate ()
119 | {
120 | if (oDispatcher != null && oEvent != null)
121 | oDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, oEvent);
122 | });
123 | }
124 |
125 | public static void AsynchSleepExecuteFunc(Dispatcher oDispatcher, AsynchWorkDelegate oEvent, double dDelayDuration = 0.3)
126 | {
127 | AddToWorkQueue(delegate ()
128 | {
129 | Thread.Sleep(TimeSpan.FromSeconds(dDelayDuration));
130 |
131 | if (oDispatcher != null && oEvent != null)
132 | oDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, oEvent);
133 | });
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Common/CvUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Security.Cryptography;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Media;
9 | using System.Windows.Media.Animation;
10 |
11 | namespace AduMusic.Common
12 | {
13 | public class CvUtils
14 | {
15 | public static Random GetRandomSeed()
16 | {
17 | byte[] bytes = new byte[4];
18 | RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
19 | rng.GetBytes(bytes);
20 | return new Random(BitConverter.ToInt32(bytes, 0));
21 | }
22 |
23 | public static bool IsImageType(string file)
24 | {
25 | //格式为jpg、png和bmp
26 | return file.ToLower().EndsWith(".jpg") ||
27 | file.ToLower().EndsWith(".jpeg") ||
28 | file.ToLower().EndsWith(".png") ||
29 | file.ToLower().EndsWith(".bmp") ||
30 | file.ToLower().EndsWith(".gif") ||
31 | file.ToLower().EndsWith(".tiff");
32 | }
33 |
34 | public static double ConvertToRads(double dDegree)
35 | {
36 | return dDegree * Math.PI / 180.0;
37 | }
38 |
39 | public static SolidColorBrush Convert16ToSolidColor(string value)
40 | {
41 | string val = value.ToString();
42 | val = val.Replace("#", "");
43 | byte a = Convert.ToByte("ff", 16);
44 | byte pos = 0;
45 | if (val.Length == 8)
46 | {
47 | a = Convert.ToByte(val.Substring(pos, 2), 16);
48 | pos = 2;
49 | }
50 | byte r = Convert.ToByte(val.Substring(pos, 2), 16);
51 | pos += 2;
52 | byte g = Convert.ToByte(val.Substring(pos, 2), 16);
53 | pos += 2;
54 | byte b = Convert.ToByte(val.Substring(pos, 2), 16);
55 | Color col = Color.FromArgb(a, r, g, b);
56 | return new SolidColorBrush(col);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Common/FolderHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AduMusic.Common
9 | {
10 | public class FolderHelper
11 | {
12 | #region 》获取文件夹下所有文件
13 |
14 | ///
15 | /// 获取文件夹下所有指定类型文件
16 | ///
17 | /// 文件夹路径
18 | /// 文件类型
19 | /// 是否递归获取子文件夹下文件, 默认为True
20 | ///
21 | public static List GetAllFileFullName(string sPath, bool IsRecursive = true)
22 | {
23 | List ltFiles = new List();
24 |
25 | FolderHelper oFolderOperation = new FolderHelper(sPath);
26 | oFolderOperation.GetAllFiles(IsRecursive);
27 | for (int i = 0; i < oFolderOperation.listAllFiles.Count; i++)
28 | {
29 | if (CvUtils.IsImageType(oFolderOperation.listAllFiles[i]))
30 | ltFiles.Add(oFolderOperation.listAllFiles[i]);
31 | }
32 | return ltFiles;
33 | }
34 |
35 | #endregion
36 |
37 | #region 》获取文件夹下所有文件夹、子文件夹
38 | ///
39 | /// 获取文件夹下所有文件夹、子文件夹
40 | ///
41 | /// 文件夹路径
42 | /// 文件夹及子文件夹下所有文件
43 | public static List GetAllFolder(string sPath, bool IsRecursive = true)
44 | {
45 | FolderHelper oFolderOperation = new FolderHelper(sPath);
46 | oFolderOperation.GetAllFiles(IsRecursive);
47 | return oFolderOperation.listAllDirs;
48 | }
49 | #endregion
50 |
51 |
52 |
53 | #region 》Folder Operation
54 |
55 | ///
56 | /// 当前文件夹
57 | ///
58 | private string FolderPath;
59 |
60 | public FolderHelper(string sFolderPath)
61 | {
62 | this.FolderPath = sFolderPath;
63 | }
64 |
65 | ///
66 | /// 文件夹、子文件夹下所有文件列表
67 | ///
68 | private List listAllFiles = new List();
69 | ///
70 | /// 文件夹、文件夹下所有子文件夹列表
71 | ///
72 | private List listAllDirs = new List();
73 |
74 | ///
75 | /// 遍历获取所有文件、所有文件夹(包含子文件夹)列表
76 | ///
77 | public void GetAllFiles(bool IsRecursive = true)
78 | {
79 | if (Directory.Exists(this.FolderPath))
80 | {
81 | this.GetAllChildDir(this.FolderPath, IsRecursive); //获取所有子文件夹
82 | if (IsRecursive)
83 | this.listAllDirs.Add(this.FolderPath); //添加跟节点文件夹
84 | }
85 | }
86 |
87 | ///
88 | /// 遍历文件夹下所有子文件夹
89 | ///
90 | /// 文件夹路径
91 | private void GetAllChildDir(string fatherPath, bool IsRecursive)
92 | {
93 | DirectoryInfo dir = new DirectoryInfo(fatherPath);
94 | FileInfo[] fis = dir.GetFiles();
95 | if (fis.Length > 0)
96 | {
97 | for (int j = 0; j < fis.Length; j++)
98 | this.listAllFiles.Add(fis[j].FullName);
99 | }
100 |
101 | try
102 | {
103 | DirectoryInfo[] dirSons = dir.GetDirectories();
104 | for (int i = 0; i < dirSons.Length; i++)
105 | {
106 | listAllDirs.Add(dirSons[i].FullName);
107 | if (IsRecursive)
108 | GetAllChildDir(dirSons[i].FullName, IsRecursive); //递归
109 | }
110 | }
111 | catch (Exception)
112 | { }
113 | }
114 |
115 | #endregion
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Controls/ImageRadioButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Media;
8 |
9 | namespace AduMusic.Controls
10 | {
11 | public class ImageRadioButton:RadioButton
12 | {
13 | public Geometry Image
14 | {
15 | get { return (Geometry)GetValue(ImageProperty); }
16 | set { SetValue(ImageProperty, value); }
17 | }
18 |
19 | public static readonly DependencyProperty ImageProperty =
20 | DependencyProperty.Register("Image", typeof(Geometry), typeof(ImageRadioButton));
21 |
22 |
23 |
24 | public double ImageWidth
25 | {
26 | get { return (double)GetValue(ImageWidthProperty); }
27 | set { SetValue(ImageWidthProperty, value); }
28 | }
29 |
30 | public static readonly DependencyProperty ImageWidthProperty =
31 | DependencyProperty.Register("ImageWidth", typeof(double), typeof(ImageRadioButton),new PropertyMetadata(20.0));
32 |
33 | public double ImageHeight
34 | {
35 | get { return (double)GetValue(ImageHeightProperty); }
36 | set { SetValue(ImageHeightProperty, value); }
37 | }
38 |
39 | public static readonly DependencyProperty ImageHeightProperty =
40 | DependencyProperty.Register("ImageHeight", typeof(double), typeof(ImageRadioButton),new PropertyMetadata(20.0));
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Fonts/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Fonts/iconfont.ttf
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Images/Background/Sys.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Background/Sys.png
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Images/Background/f3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Background/f3.jpg
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Images/ICON/128.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/ICON/128.ico
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Images/ICON/48.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/ICON/48.ico
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Images/Nor/Cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Nor/Cover.png
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Images/Nor/NorHeader.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Nor/NorHeader.jpg
--------------------------------------------------------------------------------
/AduMusic/AduMusic/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Effects;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace AduMusic
18 | {
19 | ///
20 | /// MainWindow.xaml 的交互逻辑
21 | ///
22 | public partial class MainWindow : Window
23 | {
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
30 | {
31 | this.DragMove();
32 | }
33 |
34 | private void Close_Click(object sender, RoutedEventArgs e)
35 | {
36 | //Application.Current.Shutdown();
37 | Environment.Exit(0);
38 | }
39 |
40 | private void Mini_Click(object sender, RoutedEventArgs e)
41 | {
42 | MiniWindow mw = new MiniWindow(this);
43 | mw.Show();
44 | this.Hide();
45 |
46 | }
47 |
48 | private void Max_Click(object sender, RoutedEventArgs e)
49 | {
50 | WindowStateChange();
51 | }
52 | private void WindowStateChange()
53 | {
54 | if (this.WindowState == WindowState.Maximized)
55 | {
56 | this.WindowState = WindowState.Normal;
57 | }
58 | else
59 | {
60 | this.WindowState = WindowState.Maximized;
61 | }
62 | }
63 | private void Window_StateChanged(object sender, EventArgs e)
64 | {
65 | DropShadowEffect de = null;
66 | if (this.WindowState == WindowState.Normal)
67 | {
68 | de = new DropShadowEffect();
69 | this.BorderThickness = new Thickness(20);
70 | de.BlurRadius = 20;
71 | de.Opacity = .15;
72 | de.ShadowDepth = 0;
73 | this.Effect = de;
74 | }
75 | else
76 | {
77 | this.BorderThickness = new Thickness(5);
78 | this.Effect = null;
79 | }
80 | }
81 |
82 | private void Min_Click(object sender, RoutedEventArgs e)
83 | {
84 | this.WindowState = WindowState.Minimized;
85 | }
86 |
87 | private void ImageRadioButton_Click(object sender, RoutedEventArgs e)
88 | {
89 | RadioButton radio = (RadioButton)sender;
90 | mainFrame.Navigate(new Uri(radio.Tag.ToString(), UriKind.Relative));
91 | }
92 |
93 | private void Button_Click(object sender, RoutedEventArgs e)
94 | {
95 | UserLogin ul = new UserLogin();
96 | ul.Show();
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/MiniWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/MiniWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace AduMusic
16 | {
17 | ///
18 | /// MiniWindow.xaml 的交互逻辑
19 | ///
20 | public partial class MiniWindow : Window
21 | {
22 | MainWindow mw = null;
23 | public MiniWindow(MainWindow mws)
24 | {
25 | mw = mws;
26 | InitializeComponent();
27 | }
28 |
29 | private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
30 | {
31 | this.DragMove();
32 | }
33 |
34 | private void Button_Click(object sender, RoutedEventArgs e)
35 | {
36 | mw.Show();
37 | this.Close();
38 | }
39 |
40 | private void Grid_MouseEnter(object sender, MouseEventArgs e)
41 | {
42 | btnMax.Visibility = Visibility;
43 | btnClose.Visibility = Visibility;
44 | btnUp.Visibility = Visibility;
45 | btnPlay.Visibility = Visibility;
46 | btnNext.Visibility = Visibility;
47 | }
48 |
49 | private void Grid_MouseLeave(object sender, MouseEventArgs e)
50 | {
51 | btnMax.Visibility =Visibility.Collapsed;
52 | btnClose.Visibility = Visibility.Collapsed;
53 | btnUp.Visibility = Visibility.Collapsed;
54 | btnPlay.Visibility = Visibility.Collapsed;
55 | btnNext.Visibility = Visibility.Collapsed;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // 有关程序集的常规信息通过以下
8 | // 特性集控制。更改这些特性值可修改
9 | // 与程序集关联的信息。
10 | [assembly: AssemblyTitle("AduMusic")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("AduMusic")]
15 | [assembly: AssemblyCopyright("Copyright © 2018")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // 将 ComVisible 设置为 false 使此程序集中的类型
20 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
21 | // 则将该类型上的 ComVisible 特性设置为 true。
22 | [assembly: ComVisible(false)]
23 |
24 | //若要开始生成可本地化的应用程序,请在
25 | // 中的 .csproj 文件中
26 | //设置 CultureYouAreCodingWith。 例如,如果您在源文件中
27 | //使用的是美国英语,请将 设置为 en-US。 然后取消
28 | //对以下 NeutralResourceLanguage 特性的注释。 更新
29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置
36 | //(在页面或应用程序资源词典中
37 | // 未找到某个资源的情况下使用)
38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
39 | //(在页面、应用程序或任何主题特定资源词典中
40 | // 未找到某个资源的情况下使用)
41 | )]
42 |
43 |
44 | // 程序集的版本信息由下面四个值组成:
45 | //
46 | // 主版本
47 | // 次版本
48 | // 生成号
49 | // 修订号
50 | //
51 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
52 | // 方法是按如下所示使用“*”:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AduMusic.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的、缓存的 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AduMusic.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
56 | /// 方法是使用此强类型资源类。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AduMusic.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Carousel/Carousel2DView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
14 |
15 |
20 |
21 |
22 |
23 |
29 |
33 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Carousel/Carousel2DView.xaml.cs:
--------------------------------------------------------------------------------
1 | using AduMusic.Common;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace AduMusic.Styles.Carousel
18 | {
19 | ///
20 | /// Carousel2DView.xaml 的交互逻辑
21 | ///
22 | public partial class Carousel2DView : UserControl
23 | {
24 | private List FileItems;
25 |
26 | public Carousel2DView(List ltFiles)
27 | {
28 | InitializeComponent();
29 |
30 | this.FileItems = ltFiles;
31 |
32 | this.Loaded += Carousel2DView_Loaded;
33 | this.Unloaded += Carousel2DView_Unloaded;
34 | }
35 |
36 | private void Carousel2DView_Unloaded(object sender, RoutedEventArgs e)
37 | {
38 | this.Unloaded -= Carousel2DView_Unloaded;
39 | }
40 |
41 | private void Carousel2DView_Loaded(object sender, RoutedEventArgs e)
42 | {
43 | this.Loaded -= Carousel2DView_Loaded;
44 |
45 | this.CreateElements();
46 |
47 | this.GdRoot.MouseLeftButtonDown += GdRoot_MouseLeftButtonDown;
48 | this.MouseMove += Carousel2DView_MouseMove;
49 | this.MouseUp += Carousel2DView_MouseUp;
50 | }
51 |
52 |
53 | #region Create Elements
54 |
55 | private double Radius = 650d;
56 | private double VisualCount = 10d;
57 | private List ElementList;
58 | private double CenterDegree = 180d;
59 | private double TotalDegree = 0;
60 | private double ElementWidth = 480;
61 | private double ElementHeight = 190;
62 |
63 | private double GetScaledSize(double degrees)
64 | {
65 | return GetCoefficient(degrees);
66 | }
67 |
68 | private double GetCoefficient(double degrees)
69 | {
70 | return 1.0 - Math.Cos(ConvertToRads(degrees)) / 2.0 - 0.5;
71 | }
72 |
73 | private double ConvertToRads(double degrees)
74 | {
75 | return degrees * Math.PI / 180.0;
76 | }
77 |
78 | private int GetZValue(double degrees)
79 | {
80 | return (int)((360 * GetCoefficient(degrees)) * 1000);
81 | }
82 |
83 | private void CreateElements()
84 | {
85 | double dAverageDegree = 360d / VisualCount;
86 | this.TotalDegree = this.FileItems.Count * dAverageDegree;
87 |
88 | this.ElementList = new List();
89 | for (int i = 0; i < this.FileItems.Count; i++)
90 | {
91 | ImageItem oItem = new ImageItem(FileItems[i]);
92 | oItem.MouseLeftButtonDown += OItem_MouseLeftButtonDown;
93 | oItem.MouseLeftButtonUp += OItem_MouseLeftButtonUp;
94 | oItem.Width = this.ElementWidth;
95 | oItem.Height = this.ElementHeight;
96 | oItem.Y = 0d;
97 | oItem.Degree = i * dAverageDegree;
98 | this.ElementList.Add(oItem);
99 | }
100 |
101 | this.UpdateLocation();
102 | }
103 |
104 | private ImageItem CurNavItem;
105 |
106 | private void OItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
107 | {
108 | if (this.IsMouseDown && CurNavItem == sender && this.TotalMoveDegree < 50)
109 | {
110 | this.InertiaDegree = CenterDegree - this.CurNavItem.Degree;
111 | this.CurNavItem = null;
112 | this.IsMouseDown = false;
113 | if (this.InertiaDegree != 0)
114 | CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
115 | e.Handled = true;
116 | }
117 | }
118 |
119 | private void OItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
120 | {
121 | CurNavItem = sender as ImageItem;
122 | }
123 |
124 | private void UpdateLocation()
125 | {
126 | for (int i = 0; i < this.ElementList.Count; i++)
127 | {
128 | ImageItem oItem = this.ElementList[i];
129 |
130 | if (oItem.Degree - this.CenterDegree >= this.TotalDegree / 2d)
131 | oItem.Degree -= this.TotalDegree;
132 | else if (this.CenterDegree - oItem.Degree > this.TotalDegree / 2d)
133 | oItem.Degree += this.TotalDegree;
134 |
135 | if (oItem.Degree >= 90d && oItem.Degree < 270d) // Degree 在90-270之间的显示
136 | this.SetElementVisiable(oItem);
137 | else
138 | this.SetElementInvisiable(oItem);
139 | }
140 | }
141 |
142 | private void SetElementVisiable(ImageItem oItem)
143 | {
144 | if (oItem == null)
145 | return;
146 |
147 | if (!oItem.IsVisible)
148 | {
149 | if (!this.CvMain.Children.Contains(oItem))
150 | {
151 | oItem.IsVisible = true;
152 | this.CvMain.Children.Add(oItem);
153 | }
154 | }
155 |
156 | this.DoUpdateElementLocation(oItem);
157 | }
158 |
159 | private void SetElementInvisiable(ImageItem oItem)
160 | {
161 | if (oItem.IsVisible)
162 | {
163 | if (this.CvMain.Children.Contains(oItem))
164 | {
165 | this.CvMain.Children.Remove(oItem);
166 | oItem.IsVisible = false;
167 | }
168 | }
169 | }
170 |
171 | public void DoUpdateElementLocation(ImageItem oItem)
172 | {
173 | double CenterX = this.GdRoot.Width / 2.0;
174 | double dX = -Radius * Math.Sin(ConvertToRads(oItem.Degree));
175 | oItem.X = (dX + CenterX - this.ElementWidth / 2d);
176 | double dScale = GetScaledSize(oItem.Degree);
177 | oItem.ScaleX = dScale;
178 | oItem.ScaleY = dScale;
179 | //oItem.Opacity = dScale;
180 | int nZIndex = GetZValue(oItem.Degree);
181 | Canvas.SetZIndex(oItem, nZIndex);
182 | }
183 |
184 | #endregion
185 |
186 |
187 | #region Drag And Move
188 |
189 | private bool IsMouseDown = false;
190 | private double PreviousX = 0;
191 | private double CurrentX = 0;
192 | private double IntervalDegree = 0;
193 | private double InertiaDegree = 0;
194 | private double TotalMoveDegree = 0;
195 |
196 | private void GdRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
197 | {
198 | this.IsMouseDown = true;
199 | this.IntervalDegree = 0;
200 | this.PreviousX = e.GetPosition(this).X;
201 | this.TotalMoveDegree = 0;
202 | CompositionTarget.Rendering -= new EventHandler(CompositionTarget_Rendering);
203 | }
204 |
205 | private void Carousel2DView_MouseMove(object sender, MouseEventArgs e)
206 | {
207 | if (this.IsMouseDown)
208 | {
209 | this.CurrentX = e.GetPosition(this).X;
210 | this.IntervalDegree = this.CurrentX - this.PreviousX;
211 | this.TotalMoveDegree += Math.Abs(this.IntervalDegree * 0.5d);
212 | this.InertiaDegree = this.IntervalDegree * 5d;
213 |
214 | for (int i = 0; i < this.ElementList.Count; i++)
215 | {
216 | ImageItem oItem = this.ElementList[i];
217 | oItem.Degree += this.IntervalDegree;
218 | }
219 | this.UpdateLocation();
220 | this.PreviousX = this.CurrentX;
221 | }
222 | }
223 |
224 | private void Carousel2DView_MouseUp(object sender, MouseButtonEventArgs e)
225 | {
226 | if (this.IsMouseDown)
227 | {
228 | this.IsMouseDown = false;
229 | this.CurNavItem = null;
230 | if (this.InertiaDegree != 0)
231 | CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
232 | }
233 | }
234 |
235 | private void CompositionTarget_Rendering(object sender, EventArgs e)
236 | {
237 | double dIntervalDegree = this.InertiaDegree * 0.1;
238 | for (int i = 0; i < this.ElementList.Count; i++)
239 | {
240 | ImageItem oItem = this.ElementList[i];
241 | oItem.Degree += dIntervalDegree;
242 | }
243 | this.UpdateLocation();
244 |
245 | this.InertiaDegree -= dIntervalDegree;
246 | if (Math.Abs(this.InertiaDegree) < 0.1)
247 | CompositionTarget.Rendering -= new EventHandler(CompositionTarget_Rendering);
248 | }
249 |
250 | #endregion
251 |
252 | //public event Action OnReturn;
253 |
254 | //private void BdrReturn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
255 | //{
256 | // this.BdrReturn.MouseLeftButtonDown -= BdrReturn_MouseLeftButtonDown;
257 | // CompositionTarget.Rendering -= new EventHandler(CompositionTarget_Rendering);
258 | // this.IsEnabled = false;
259 |
260 | // //CvUtils.EffectAnimation(this, new FadeTransitionEffect(), false, null, null, 0.5d, 0d,
261 | // // () => {
262 | // if (this.OnReturn != null)
263 | // this.OnReturn();
264 | // //});
265 | //}
266 | }
267 |
268 |
269 |
270 | }
271 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Carousel/ImageItem.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Carousel/ImageItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using AduMusic.API;
2 | using AduMusic.Common;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 | using System.Windows.Data;
12 | using System.Windows.Documents;
13 | using System.Windows.Input;
14 | using System.Windows.Media;
15 | using System.Windows.Media.Imaging;
16 | using System.Windows.Navigation;
17 | using System.Windows.Shapes;
18 |
19 | namespace AduMusic.Styles.Carousel
20 | {
21 | ///
22 | /// ImageItem.xaml 的交互逻辑
23 | ///
24 | public partial class ImageItem : UserControl
25 | {
26 | public ImageItem(CarouselItem item)
27 | {
28 | InitializeComponent();
29 | this.FileSrc = item.Url;
30 | string sFileName = item.Name;
31 | this.TbkTitle.Text = sFileName;
32 | this.Loaded += ImageItem_Loaded;
33 | this.DataContext = this;
34 | }
35 | public double X
36 | {
37 | get { return (double)GetValue(XProperty); }
38 | set { SetValue(XProperty, value); }
39 | }
40 | public static readonly DependencyProperty XProperty =
41 | DependencyProperty.Register("X", typeof(double), typeof(ImageItem), new UIPropertyMetadata(0.0));
42 |
43 | public double Y
44 | {
45 | get { return (double)GetValue(YProperty); }
46 | set { SetValue(YProperty, value); }
47 | }
48 | public static readonly DependencyProperty YProperty =
49 | DependencyProperty.Register("Y", typeof(double), typeof(ImageItem), new UIPropertyMetadata(0.0));
50 |
51 | public double ScaleX
52 | {
53 | get { return (double)GetValue(ScaleXProperty); }
54 | set { SetValue(ScaleXProperty, value); }
55 | }
56 | public static readonly DependencyProperty ScaleXProperty =
57 | DependencyProperty.Register("ScaleX", typeof(double), typeof(ImageItem), new UIPropertyMetadata(1.0));
58 |
59 | public double ScaleY
60 | {
61 | get { return (double)GetValue(ScaleYProperty); }
62 | set { SetValue(ScaleYProperty, value); }
63 | }
64 | public static readonly DependencyProperty ScaleYProperty =
65 | DependencyProperty.Register("ScaleY", typeof(double), typeof(ImageItem), new UIPropertyMetadata(1.0));
66 |
67 | public double Degree;
68 | private string FileSrc="";
69 |
70 | private bool _IsVisible = false;
71 | public new bool IsVisible
72 | {
73 | get { return _IsVisible; }
74 | set
75 | {
76 | _IsVisible = value;
77 | if (value)
78 | this.LoadUiImmediate();
79 | }
80 | }
81 |
82 | private bool IsUiLoaded = false;
83 |
84 | public void LoadUiImmediate()
85 | {
86 | if (!IsUiLoaded)
87 | {
88 | IsUiLoaded = true;
89 | try {
90 | this.ImgMain.Source = PrivateMethod.GetImage(FileSrc);
91 | } catch { }
92 | }
93 | }
94 |
95 |
96 |
97 | private void ImageItem_Loaded(object sender, RoutedEventArgs e)
98 | {
99 | this.Loaded -= ImageItem_Loaded;
100 | AsynchUtils.AsynchSleepExecuteFunc(this.Dispatcher, LoadUiImmediate, 0.5);
101 | }
102 |
103 | public void Dispose()
104 | {
105 | this.ImgMain.Source = null;
106 | }
107 | }
108 |
109 | public class CarouselItem
110 | {
111 | //图片地址
112 | public string Url { get; set; }
113 | //名称
114 | public string Name { get; set; }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Carousel/InteractivePanel3D.cs:
--------------------------------------------------------------------------------
1 | using _3DTools;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Media;
9 | using System.Windows.Media.Media3D;
10 |
11 | namespace AduMusic.Styles.Carousel
12 | {
13 | public class InteractivePanel3D : InteractiveVisual3D, IDisposable
14 | {
15 | public double Degree = 0;
16 | CarouselItem item = null;
17 | public string FileSrc ="";
18 | private int Index = 0;
19 |
20 | private bool _IsVisible = false;
21 |
22 | public bool IsVisible
23 | {
24 | get { return _IsVisible; }
25 | set
26 | {
27 | _IsVisible = value;
28 | if (value && Visual != null)
29 | {
30 | ImageItem oPersonItem = this.Visual as ImageItem;
31 | if (oPersonItem != null)
32 | oPersonItem.LoadUiImmediate();
33 | }
34 | }
35 | }
36 |
37 | public InteractivePanel3D(CarouselItem item, int nIndex)
38 | {
39 | this.item = item;
40 | this.Index = nIndex;
41 |
42 | Geometry = CreateModel();
43 | Transform = this.CreateTransform();
44 | Visual = this.CreateVisual();
45 | IsBackVisible = true;
46 | }
47 |
48 | private Transform3D CreateTransform()
49 | {
50 | var trans3DGroup = new Transform3DGroup();
51 | var scale3D = new ScaleTransform3D();
52 | trans3DGroup.Children.Add(scale3D);
53 | return trans3DGroup;
54 | }
55 |
56 | internal const double y = 2.38;
57 | internal const double x = 3.80;
58 |
59 | private MeshGeometry3D CreateModel()
60 | {
61 | var geometry3D = new MeshGeometry3D();
62 | geometry3D.Positions.Add(new Point3D(-x, y, 0));
63 | geometry3D.Positions.Add(new Point3D(-x, -y, 0));
64 | geometry3D.Positions.Add(new Point3D(x, -y, 0));
65 | geometry3D.Positions.Add(new Point3D(x, y, 0));
66 |
67 | var iCol = new[] { 0, 1, 2, 0, 2, 3 };
68 | var pCol = new[] { new Point(0, 0), new Point(0, 1), new Point(1, 1), new Point(1, 0) };
69 | var vCol = new[]
70 | {new Vector3D(0, 1, 0), new Vector3D(0, 1, 0), new Vector3D(0, 1, 0), new Vector3D(0, 1, 0)};
71 |
72 | geometry3D.TriangleIndices = new Int32Collection(iCol);
73 | geometry3D.TextureCoordinates = new PointCollection(pCol);
74 | geometry3D.Normals = new Vector3DCollection(vCol);
75 |
76 | return geometry3D;
77 | }
78 |
79 | private Visual CreateVisual()
80 | {
81 | if (this.FileSrc == "")
82 | return null;
83 | ImageItem oItem = new ImageItem(this.item);
84 | return oItem;
85 | }
86 |
87 | public void Dispose()
88 | {
89 | Geometry = null;
90 | ImageItem oPersonItem = this.Visual as ImageItem;
91 | if (oPersonItem != null)
92 | oPersonItem.Dispose();
93 | Visual = null;
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/ItemControlTemp.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
28 |
29 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/ListBox.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
27 |
73 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/ListView.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
48 |
49 |
104 |
105 |
106 |
119 |
120 |
121 |
181 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Login.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/Menu.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
10 |
113 |
114 |
115 |
127 |
128 |
129 |
147 |
148 |
149 |
150 |
184 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/NorTheme.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 | #FF917B
6 |
7 | #fff
8 |
9 | #000
10 |
11 | #000
12 |
13 |
14 | #04000000
15 |
16 | #10000000
17 |
18 | #10ffffff
19 |
20 | #20ffffff
21 |
22 |
23 | #fff
24 |
25 | #000
26 |
27 | #80ffffff
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/RadioButton.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
82 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/ScrollView.xaml:
--------------------------------------------------------------------------------
1 |
3 |
23 |
45 |
67 |
149 |
150 |
151 |
278 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/TabControl.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
61 |
62 |
286 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/TabControl_Home.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
62 |
63 |
285 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/WSSlider.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
29 |
30 |
40 |
41 |
59 |
60 |
89 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Styles/WSlider.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
22 |
23 |
33 |
34 |
43 |
44 |
62 |
63 |
94 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/UserLogin.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/UserLogin.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace AduMusic
16 | {
17 | ///
18 | /// UserLogin.xaml 的交互逻辑
19 | ///
20 | public partial class UserLogin : Window
21 | {
22 | public UserLogin()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 | private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
28 | {
29 | this.DragMove();
30 | }
31 |
32 | private void btnClose_Click(object sender, RoutedEventArgs e)
33 | {
34 | this.Close();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Views/Home.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Views/Home.xaml.cs:
--------------------------------------------------------------------------------
1 | using AduMusic.Common;
2 | using AduMusic.Styles.Carousel;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | namespace AduMusic.Views
9 | {
10 | ///
11 | /// Home.xaml 的交互逻辑
12 | ///
13 | public partial class Home : Page
14 | {
15 | public Home()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void Page_Loaded(object sender, RoutedEventArgs e)
21 | {
22 | List list = new List();
23 | for (int i = 0; i < 8; i++)
24 | {
25 | Song s = new Song();
26 | s.SongName = i + "没想到你是这样的播放器";
27 | s.SingerName = "冷主播";
28 | s.cover = "https://qpic.y.qq.com/music_cover/bof4MDsSxjG6Va3xXJrNAGk5nDwflHw4er18BV1KARY3PsdBQlfupw/300?n=1";
29 | s.ZhuanName = "AduMusic";
30 | s.SongSize = "2MB";
31 | list.Add(s);
32 | }
33 | List ltFiles = new List();
34 |
35 | //List ltFiles = FolderHelper.GetAllFileFullName(sPath);
36 | if (list.Count == 0)
37 | {
38 | MessageBox.Show("未查找到素材文件!", "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
39 | }
40 | else
41 | {
42 | for (int i = 0; i < list.Count; i++)
43 | {
44 | CarouselItem item = new CarouselItem();
45 | item.Name = list[i].SongName;
46 | item.Url = list[i].cover;
47 | ltFiles.Add(item);
48 | }
49 | this.Homes.Children.Clear();
50 |
51 | Carousel2DView view2D = new Carousel2DView(ltFiles);
52 | //view2D.Width = 800;
53 | //view2D.OnReturn += View_OnReturn;
54 | this.Homes.Children.Add(view2D);
55 | //Carousel3DView view3D = new Carousel3DView(ltFiles);
56 | //view2D.Width = 800;
57 | //view2D.OnReturn += View_OnReturn;
58 | //this.Home2.Children.Add(view3D);
59 | NewHot.ItemsSource = list;
60 | }
61 |
62 | }
63 | public void View_OnReturn()
64 | {
65 | this.Homes.Children.Clear();
66 |
67 | //CurNavPage = new NavPage();
68 | //CurNavPage.OnSelectChanged += PageNav_OnSelectChanged;
69 | //this.GdMain.Children.Add(CurNavPage);
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Views/MusicList.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/Views/MusicList.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AduMusic.Views
17 | {
18 | ///
19 | /// MusicList.xaml 的交互逻辑
20 | ///
21 | public partial class MusicList : Page
22 | {
23 | public MusicList()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | private void Page_Loaded(object sender, RoutedEventArgs e)
29 | {
30 | List li_song = new List();
31 | for(int i = 0; i < 36; i++)
32 | {
33 | Song s = new Song();
34 | s.SongName = i+"没想到你是这样的播放器";
35 | s.SingerName = "冷主播";
36 | s.ZhuanName = "AduMusic";
37 | s.SongSize = "2MB";
38 | li_song.Add(s);
39 | }
40 | gridList.ItemsSource = li_song;
41 | }
42 | }
43 | public class Song
44 | {
45 | public string SingerName { get; set; }
46 | public string SongName { get; set; }
47 | public string ZhuanName { get; set; }
48 | public string SongSize { get; set; }
49 | public string cover { get; set; }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/AduMusic/AduMusic/bin/DLLs/3DTools.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/bin/DLLs/3DTools.dll
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # QQ音乐 For WPF
2 | AduMusic
3 |
4 | 该项目适合新入门学习使用
5 |
6 | .png?raw=true)
7 |
8 | .png?raw=true)
9 |
10 |
--------------------------------------------------------------------------------
/ScreenShot/Cover (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/ScreenShot/Cover (1).png
--------------------------------------------------------------------------------
/ScreenShot/Cover (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/ScreenShot/Cover (2).png
--------------------------------------------------------------------------------