Пример #1
0
        private bool SetFaved(MapIdentity identity)
        {
            var  map   = DbOperator.GetMapFromDb(identity);
            var  album = DbOperator.GetCollectionsByMap(map);
            bool faved = album != null && album.Any(k => k.Locked);

            BtnLike.Background = faved
                ? (ViewModel.IsMiniMode
                    ? (Brush)ToolControl.FindResource("FavedS")
                    : (Brush)ToolControl.FindResource("Faved"))
                : (ViewModel.IsMiniMode
                    ? (Brush)ToolControl.FindResource("FavS")
                    : (Brush)ToolControl.FindResource("Fav"));
            return(faved);
        }
Пример #2
0
        private async Task SetPlayMode(PlayerMode playmode)
        {
            switch (playmode)
            {
            case PlayerMode.Normal:
                Normal.IsChecked = true;
                break;

            case PlayerMode.Random:
                Random.IsChecked = true;
                break;

            case PlayerMode.Loop:
                Loop.IsChecked = true;
                break;

            case PlayerMode.LoopRandom:
                LoopRandom.IsChecked = true;
                break;

            case PlayerMode.Single:
                Single.IsChecked = true;
                break;

            case PlayerMode.SingleLoop:
                SingleLoop.IsChecked = true;
                break;
            }

            string flag = ViewModel.IsMiniMode ? "S" : "";

            BtnMode.Background = (ImageBrush)ToolControl.FindResource(playmode + flag);
            if (playmode == InstanceManage.GetInstance <PlayerList>().PlayerMode)
            {
                return;
            }
            InstanceManage.GetInstance <PlayerList>().PlayerMode = playmode;
            await InstanceManage.GetInstance <PlayerList>().RefreshPlayListAsync(PlayerList.FreshType.IndexOnly);

            PlayerConfig.Current.Play.PlayListMode = playmode;
            PlayerConfig.SaveCurrent();
        }
Пример #3
0
        private void SetPlayMode(PlayerMode playmode)
        {
            switch (playmode)
            {
            case PlayerMode.Normal:
                Normal.IsChecked = true;
                break;

            case PlayerMode.Random:
                Random.IsChecked = true;
                break;

            case PlayerMode.Loop:
                Loop.IsChecked = true;
                break;

            case PlayerMode.LoopRandom:
                LoopRandom.IsChecked = true;
                break;

            case PlayerMode.Single:
                Single.IsChecked = true;
                break;

            case PlayerMode.SingleLoop:
                SingleLoop.IsChecked = true;
                break;
            }

            string flag = ViewModel.IsMiniMode ? "S" : "";

            BtnMode.Background = (ImageBrush)ToolControl.FindResource(playmode + flag);
            if (playmode == App.PlayerList.PlayerMode)
            {
                return;
            }
            App.PlayerList.PlayerMode = playmode;
            App.PlayerList.RefreshPlayList(PlayerList.FreshType.IndexOnly);
            App.Config.Play.PlayListMode = playmode;
            App.SaveConfig();
        }