Exemplo n.º 1
0
 internal void InitPlayList(User user)
 {
     currentUser               = user;
     playListViewModel         = new PlayListViewModel(user);
     cbPlayLists.ItemsSource   = playListViewModel.PlayLists;
     cbPlayLists.SelectedIndex = 0;
 }
Exemplo n.º 2
0
        public PlayListDetailPage(PlayListViewModel playList)
        {
            this.playList = playList;//Asignamos objeto

            InitializeComponent();

            title.Text = playList.Title;
        }
Exemplo n.º 3
0
 private void OnPlayListChanged()
 {
     if (PlayListViewModel != null)
     {
         PlayListViewModel.InitialPlayList(PlayList);
         ControlViewModel.PlayingSongOperator.IsPlayingListChanged = true;
     }
 }
Exemplo n.º 4
0
        public PlayList()
        {
            InitializeComponent();

            LoadingPopup ovr = new LoadingPopup();

            loadingGrid.Children.Add(ovr);

            _vm = new PlayListViewModel();
            this.DataContext = _vm;
        }
Exemplo n.º 5
0
        public MainViewModel()
        {
            SongListViewModel  = new SongListViewModel(this);
            PlayListViewModel  = new PlayListViewModel(this);
            TagsPanelViewModel = new TagsPanelViewModel(this);
            ControlViewModel   = new ControlViewModel(this);

            SongList = SongListModel.Instance.GetSongsDb();
            PlayList = PlayListModel.Instance.LoadSongs(SongList);

            SelectTagsCommand = new DelegateCommand <Button>(OnSelectTags);
            ClosingCommand    = new DelegateCommand(OnClosing);
        }
Exemplo n.º 6
0
 public MainWindow()
 {
     InitializeComponent();
     WindowStartupLocation        = System.Windows.WindowStartupLocation.CenterScreen;
     playListViewModel            = new PlayListViewModel();
     this.DataContext             = playListViewModel;
     playlistLstBox.ItemsSource   = PlayListViewModel.ListBoxItems;
     playlistLstBox.SelectedIndex = 0;
     playlistLstBox.AllowDrop     = true;
     playlistLstBox.DragEnter    += playlistLstBox_DragEnter;
     playlistLstBox.Drop         += playlistLstBox_Drop;
     playlistLstBox.KeyUp        += playlistLstBox_KeyUp;
 }
Exemplo n.º 7
0
        private void playlistLstBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            ListBox listBox = sender as ListBox;

            PlayListViewModel playListViewModel = DataContext as PlayListViewModel;

            listBoxSelectedItems = new List <PlayListModel>();

            foreach (var item in listBox.SelectedItems)
            {
                listBoxSelectedItems.Add((PlayListModel)item);
            }

            playListViewModel.SelectedItems = null;
            playListViewModel.SelectedItems = listBoxSelectedItems;
        }
Exemplo n.º 8
0
        internal async Task AddPlayList(PlayListViewModel p)
        {
            Category.SelectionChanged -= Category_SelectionChanged;
            await InitCategoryList();

            var item = CategoryList.FirstOrDefault(x => x.Title == Settings.Current.CategoryLastClicked);

            Category.SelectionChanged += Category_SelectionChanged;
            if (item != default(CategoryListItem))
            {
                Category.SelectedIndex = CategoryList.IndexOf(item);
            }
            else
            {
                Category.SelectedIndex = 0;
            }
        }
Exemplo n.º 9
0
        private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (PlaylistTitle.Text.IsNullorEmpty())
            {
                return;
            }
            var p = new PlayListViewModel()
            {
                Title = PlaylistTitle.Text,
            };
            await p.SaveAsync();

            Playlists.Add(p);

            AddBtn.Visibility   = Visibility.Visible;
            PlaylistTitle.Text  = string.Empty;
            AddPanel.Visibility = Visibility.Collapsed;
        }
Exemplo n.º 10
0
 public void ChangePlaylistNameClick(object param)
 {
     if (TextInput == null)
     {
         PopUpWarning = "Please insert a valid name"; // warning appears when the textbox was left empty
     }
     else if (TextInput.Length >= 32)
     {
         PopUpWarning = "Name can't be longer than 32 characters"; // warning appears when the name is 32 characters long
     }
     else if (TextInput.Equals(PlayListViewModel.PlaylistName))    //If the name didn't change
     {
         PopUpWarning = "The name can't be the same as the old name";
     }
     else
     {
         string sqlquery = $"UPDATE Playlist SET name = '{TextInput}' WHERE {PlaylistID} = idPlaylist"; // also updates the database name
         DatabaseConnector.UpdateQueryDB(sqlquery);
         PlayListViewModel.ChangeName(TextInput);                                                       // changes the name on the application
         TryClose();
     }
 }
Exemplo n.º 11
0
        private async void AddComplete(object sender, RoutedEventArgs e)
        {
            if (PlaylistTitle.Text.IsNullorEmpty())
            {
                return;
            }
            var p = new PlayListViewModel()
            {
                Title = PlaylistTitle.Text,
            };
            await p.SaveAsync();

            Playlists.Add(p);

            AddBtn.Visibility   = Visibility.Visible;
            PlaylistTitle.Text  = string.Empty;
            AddPanel.Visibility = Visibility.Collapsed;
            if (LibraryPage.Current != null)
            {
                await LibraryPage.Current.AddPlayList(p);
            }
        }
 public PlayListView(PlayListViewModel data)
 {
     InitializeComponent();
     this.DataContext = data;
 }
Exemplo n.º 13
0
        public PlayListPage(PlayListViewModel playlistVM)
        {
            InitializeComponent();

            this.DataContext = playlistVM;
        }
Exemplo n.º 14
0
 public PlayListView()
 {
     InitializeComponent();
     BindingContext = new PlayListViewModel();
 }
Exemplo n.º 15
0
 public PlayListView()
 {
     InitializeComponent();
     PlayListViewModel = new PlayListViewModel(Navigation);
     BindingContext    = PlayListViewModel;
 }
Exemplo n.º 16
0
 public StopCmd(DataSet ds, PlayListViewModel pvm)
 {
     this.ds  = ds;
     this.pvm = pvm;
 }
Exemplo n.º 17
0
 public RowMovementCmd(DataSet ds, PlayListViewModel pvm)
 {
     this.ds  = ds;
     this.pvm = pvm;
 }