Exemplo n.º 1
0
        public AmpacheView(AmpacheViewModel vm)
        {
            viewModel           = vm;
            vm.PropertyChanged += HandleVmPropertyChanged;
            btnConnect.Label    = _("Connect");
            PackStart(btnConnect, false, false, 1);
            artistsWindow.Add(lvArtists);
            filterBox.PackStart(artistsWindow, true, true, 1);
            albumWindow.Add(lvAlbums);
            filterBox.PackStart(albumWindow, true, true, 1);
            playlistWindow.Add(lvPlaylists);
            filterBox.PackStart(playlistWindow, true, true, 1);
            PackStart(filterBox, true, true, 1);
            trackWindow.Add(lvTracks);
            PackStart(trackWindow, true, true, 1);

            lvArtists.ColumnController = BuildDisplayColumnController(_("Artist"));
            lvArtists.SetModel(artistModel);
            lvAlbums.ColumnController = BuildDisplayColumnController(_("Album"));
            lvAlbums.SetModel(albumModel);
            lvPlaylists.ColumnController = BuildDisplayColumnController(_("Playlist"));
            lvPlaylists.SetModel(playlistModel);
            lvTracks.ColumnController = BuildDisplayColumnController(_("Title"));
            lvTracks.ColumnController.Add(new Column(new ColumnDescription("DisplayArtistName", _("Artist"), 100)));
            lvTracks.ColumnController.Add(new Column(new ColumnDescription("DisplayAlbumTitle", _("Album"), 100)));
            lvTracks.SetModel(trackModel);
            ShowAll();

            lvArtists.Model.Selection.Changed   += HandleLvArtistsModelSelectionChanged;
            lvAlbums.Model.Selection.Changed    += HandleLvAlbumsModelSelectionChanged;
            lvPlaylists.Model.Selection.Changed += HandleLvPlaylistsModelSelectionChanged;
            lvTracks.Model.Selection.Changed    += HandleLvTracksModelSelectionChanged;

            if (!string.IsNullOrEmpty(AmpacheSource.UserName.Get()))
            {
                btnConnect.Hide();
                System.Threading.ThreadPool.QueueUserWorkItem((o) => viewModel.ConnectCommand());
            }
        }
 public AmpacheSourceContents()
 {
     ViewModel = new AmpacheViewModel();
     View =  new AmpacheView(ViewModel);
 }
Exemplo n.º 3
0
 public AmpacheSourceContents()
 {
     ViewModel = new AmpacheViewModel();
     View      = new AmpacheView(ViewModel);
 }