コード例 #1
0
        public CollectionViewModel(ICollectionService service, CollectionCommandHelper commands)
        {
            _service  = service;
            _commands = commands;

            SongClickCommand = new RelayCommand <ItemClickEventArgs>(SongClickExecute);

            if (IsInDesignModeStatic)
            {
                _service.LoadLibrary();
            }

            SortedSongs = AlphaKeyGroup <Song> .CreateGroups(Service.Songs.Where(p => !p.IsTemp).ToList(),
                                                             CultureInfo.CurrentCulture, item => item.Name, true);

            SortedArtists = AlphaKeyGroup <Artist> .CreateGroups(Service.Artists.Where(p => p.Songs.Count > 0).ToList(),
                                                                 CultureInfo.CurrentCulture, item => item.Name, true);

            SortedAlbums = AlphaKeyGroup <Album> .CreateGroups(Service.Albums.Where(p => p.Songs.Count > 0).ToList(),
                                                               CultureInfo.CurrentCulture, item => item.Name, true);

            Service.Songs.CollectionChanged   += OnCollectionChanged;
            Service.Albums.CollectionChanged  += OnCollectionChanged;
            Service.Artists.CollectionChanged += OnCollectionChanged;
        }
コード例 #2
0
 public CollectionArtistViewModel(ICollectionService service, CollectionCommandHelper commands, SettingViewModel settingViewModel)
 {
     _service          = service;
     _commands         = commands;
     _songClickCommand = new Command <ItemClickEventArgs>(SongClickExecute);
     SettingViewModel  = settingViewModel;
 }
コード例 #3
0
 public NowPlayingViewModel(IScrobblerService service, ICollectionService collection, CollectionCommandHelper commands)
 {
     _service               = service;
     _commands              = commands;
     _collection            = collection;
     _songClickRelayCommand = new Command <ItemClickEventArgs>(SongClickExecute);
     SimilarTracks          = new ObservableCollection <Base>();
 }
コード例 #4
0
 public SpotifyAlbumViewModel(ISpotifyService spotify,
                              IScrobblerService service,
                              IMiscellaneousService misc,
                              CollectionCommandHelper commands)
 {
     _service  = service;
     _misc     = misc;
     _commands = commands;
     _songClickRelayCommand = new Command <ItemClickEventArgs>(SongClickExecute);
 }
コード例 #5
0
 public CollectionAlbumViewModel(ICollectionService service, CollectionCommandHelper commands)
 {
     _service = service;
     _commands = commands;
     _songClickCommand = new RelayCommand<ItemClickEventArgs>(SongClickExecute);
     
     if (IsInDesignMode)
         SetAlbum(0);
     else MessengerInstance.Register<GenericMessage<int>>(this, "album-coll-detail-id", ReceivedId);
 }
コード例 #6
0
        public CollectionArtistViewModel(ICollectionService service, CollectionCommandHelper commands, IScrobblerService lastService)
        {
            _service = service;
            _commands = commands;
            _lastService = lastService;
            _songClickCommand = new RelayCommand<ItemClickEventArgs>(SongClickExecute);
            MessengerInstance.Register<int>(this, "artist-coll-detail-id", ReceivedId);

            if (IsInDesignMode)
                SetArtist(0);
        }
コード例 #7
0
        public CollectionArtistViewModel(ICollectionService service, CollectionCommandHelper commands, IScrobblerService lastService)
        {
            _service          = service;
            _commands         = commands;
            _lastService      = lastService;
            _songClickCommand = new RelayCommand <ItemClickEventArgs>(SongClickExecute);
            MessengerInstance.Register <int>(this, "artist-coll-detail-id", ReceivedId);

            if (IsInDesignMode)
            {
                SetArtist(0);
            }
        }
コード例 #8
0
ファイル: MainViewModel.cs プロジェクト: yakuz-a/Airstem
        public MainViewModel(ICollectionService service, IMiscellaneousService misc, CollectionCommandHelper commands, Data.Service.Interfaces.IScrobblerService scroble,
                             PlayerViewModel _playerModel)
        {
            _service  = service;
            _commands = commands;
            _scroble  = scroble;
            _misc     = misc;

            PlayerModel     = _playerModel;
            Message         = Core.StringMessage.LoadingPleaseWait;
            WhatsNewMessage = Core.StringMessage.LoadingPleaseWait;

            _songClickCommand       = new Command <ItemClickEventArgs>(SongClickExecute);
            _service.LibraryLoaded += _service_LibraryLoaded;
        }
コード例 #9
0
        public CollectionAlbumViewModel(ICollectionService service, CollectionCommandHelper commands)
        {
            _service          = service;
            _commands         = commands;
            _songClickCommand = new RelayCommand <ItemClickEventArgs>(SongClickExecute);

            if (IsInDesignMode)
            {
                SetAlbum(0);
            }
            else
            {
                MessengerInstance.Register <GenericMessage <int> >(this, "album-coll-detail-id", ReceivedId);
            }
        }
コード例 #10
0
        public SearchViewModel(IScrobblerService service,
                               ISpotifyService spotify,
                               IMiscellaneousService misc,
                               IDeezerService deezer,
                               CollectionCommandHelper commands)
        {
            _spotify  = spotify;
            _service  = service;
            _misc     = misc;
            _deezer   = deezer;
            _commands = commands;



            KeyDownRelayCommand   = new Command <KeyRoutedEventArgs>(KeyDownExecute);
            SongClickRelayCommand = new Command <ItemClickEventArgs>(SongClickExecute);
            VideoClickCommand     = new Command <ItemClickEventArgs>(VideoClickExecute);
        }
コード例 #11
0
        public CollectionViewModel(ICollectionService service, IMiscellaneousService misc, CollectionCommandHelper commands)
        {
            _service  = service;
            _commands = commands;
            _misc     = misc;

            SongClickCommand  = new Command <ItemClickEventArgs>(SongClickExecute);
            VideoClickCommand = new Command <ItemClickEventArgs>(VideoClickExecute);

            SortedSongs = AlphaKeyGroup <Song> .CreateGroups(Service.Songs.Where(p => !p.IsTemp).ToList(),
                                                             CultureInfo.CurrentCulture, item => item.Name, true);

            SortedArtists = AlphaKeyGroup <Artist> .CreateGroups(Service.Artists.Where(p => p.Songs.Count > 0).ToList(),
                                                                 CultureInfo.CurrentCulture, item => item.Name, true);

            SortedAlbums = AlphaKeyGroup <Album> .CreateGroups(Service.Albums.Where(p => p.Songs.Count > 0).ToList(),
                                                               CultureInfo.CurrentCulture, item => item.Name, true);

            SortedVideos = AlphaKeyGroup <Video> .CreateGroups(Service.Videos, CultureInfo.CurrentCulture, item => item.Title, true);//Service.Videos;


            InitAsync();
        }
コード例 #12
0
 public CollectionSearchViewModel(CollectionCommandHelper commands, ICollectionService service)
 {
     _commands = commands;
     _service  = service;
 }