internal void InitPlayList(User user) { currentUser = user; playListViewModel = new PlayListViewModel(user); cbPlayLists.ItemsSource = playListViewModel.PlayLists; cbPlayLists.SelectedIndex = 0; }
public PlayListDetailPage(PlayListViewModel playList) { this.playList = playList;//Asignamos objeto InitializeComponent(); title.Text = playList.Title; }
private void OnPlayListChanged() { if (PlayListViewModel != null) { PlayListViewModel.InitialPlayList(PlayList); ControlViewModel.PlayingSongOperator.IsPlayingListChanged = true; } }
public PlayList() { InitializeComponent(); LoadingPopup ovr = new LoadingPopup(); loadingGrid.Children.Add(ovr); _vm = new PlayListViewModel(); this.DataContext = _vm; }
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); }
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; }
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; }
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; } }
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; }
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(); } }
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; }
public PlayListPage(PlayListViewModel playlistVM) { InitializeComponent(); this.DataContext = playlistVM; }
public PlayListView() { InitializeComponent(); BindingContext = new PlayListViewModel(); }
public PlayListView() { InitializeComponent(); PlayListViewModel = new PlayListViewModel(Navigation); BindingContext = PlayListViewModel; }
public StopCmd(DataSet ds, PlayListViewModel pvm) { this.ds = ds; this.pvm = pvm; }
public RowMovementCmd(DataSet ds, PlayListViewModel pvm) { this.ds = ds; this.pvm = pvm; }