private void TryBindHotKeys() { var page = new Pages.Settings.HotKeyPage(); OverallKeyHook.AddKeyHook(page.PlayPause.Name, () => { PlayController.Default.TogglePlay(); }); OverallKeyHook.AddKeyHook(page.Previous.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Next.Name, async() => { await PlayController.Default.PlayNext(); }); OverallKeyHook.AddKeyHook(page.VolumeUp.Name, () => { AppSettings.Current.Volume.Main += 0.05f; }); OverallKeyHook.AddKeyHook(page.VolumeDown.Name, () => { AppSettings.Current.Volume.Main -= 0.05f; }); OverallKeyHook.AddKeyHook(page.FullMini.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.AddToFav.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Lyric.Name, () => { if (LyricWindow.IsShown) { LyricWindow.Hide(); } else { LyricWindow.Show(); } }); }
private void TryBindHotkeys() { var page = new Pages.Settings.HotKeyPage(this); OverallKeyHook.AddKeyHook(page.PlayPause.Name, () => { BtnPlay_Click(null, null); }); OverallKeyHook.AddKeyHook(page.Previous.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Next.Name, () => { BtnNext_Click(null, null); }); OverallKeyHook.AddKeyHook(page.VolumeUp.Name, () => { PlayerConfig.Current.Volume.Main += 0.05f; }); OverallKeyHook.AddKeyHook(page.VolumeDown.Name, () => { PlayerConfig.Current.Volume.Main -= 0.05f; }); OverallKeyHook.AddKeyHook(page.FullMini.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.AddToFav.Name, () => { //TODO }); OverallKeyHook.AddKeyHook(page.Lyric.Name, () => { if (LyricWindow.IsHide) { LyricWindow.Show(); } else { LyricWindow.Hide(); } }); }