private void Create_Click(object sender, RoutedEventArgs e)
        {
            Create_Playlist createPlaylist = new Create_Playlist();

            createPlaylist.ShowDialog();
            loadPlaylist();
        }
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var    image            = e.AddedItems[0] as ComboBoxItem;
            string currentOperation = image.Content.ToString();

            var       ttp       = sender as ComboBox;
            Playlists playlists = null;

            if (image != null && ttp.Tag is Playlists)
            {
                playlists = (Playlists)ttp.Tag;
            }

            if (playlists != null)
            {
                Create_Playlist create_Playlist = new Create_Playlist();
                Global_Log.pID          = playlists.PID;
                Global_Log.playlistName = playlists.Name;

                if (currentOperation == "Update")
                {
                    create_Playlist.SetProperty(playlists.Name.ToString());
                }
                else if (currentOperation == "Delete")
                {
                    create_Playlist.deletePlaylist(playlists.PID);
                }
                else if (currentOperation == "View")
                {
                    currentPlaylist = playlists.PID;

                    loadPlaylistSong(playlists.SortId, Global_Log.pID);
                }
                else if (currentOperation == "Schedule")
                {
                    currentPlaylist = playlists.PID;
                    Schedular schedular = new Schedular();
                    schedular.ShowDialog();
                    //loadPlaylistSong(Global_Log.pID, playlists.SortId);
                }
            }
            loadPlaylist();
        }
        private void PlaylistSongEdit_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var sa = this.LogicalChildren;
            { }
            var    image            = e.AddedItems[0] as ComboBoxItem;
            string currentOperation = image.Content.ToString();

            var           ttp           = sender as ComboBox;
            PlaylistAudio PlaylistAudio = null;

            if (image != null && ttp.Tag is PlaylistAudio)
            {
                PlaylistAudio = (PlaylistAudio)ttp.Tag;
            }

            if (PlaylistAudio != null)
            {
                Create_Playlist create_Playlist = new Create_Playlist();
                Global_Log.pID          = PlaylistAudio.PID;
                Global_Log.playlistName = PlaylistAudio.Name;

                selectedIndexValue = 0;

                plays = new List <PlaylistAudio>();
                foreach (PlaylistAudio item in PlaylistSong.Items)
                {
                    plays.Add(item);
                }

                if (currentOperation == "Play")
                {
                    //PlaylistSong
                    Global_Log.allSongTrack = false;

                    if (Global_Log.bottom_Media_Control == null)
                    {
                        Global_Log.bottom_Media_Control = new Bottom_Media_Control.Bottom_Media_Control();
                    }
                    Global_Log.bottom_Media_Control.playSong(PlaylistAudio.track, PlaylistAudio.Name,
                                                             PlaylistAudio.Trim_Start, PlaylistAudio.Trim_End, PlaylistAudio.Intro, PlaylistAudio.EOM);
                }
                else if (currentOperation == "Delete")
                {
                    string query = "delete playlist where PID =" + PlaylistAudio.PID + "and AID = " + PlaylistAudio.AID;
                    Global_Log.connectionClass.insertData(query);
                }
                //else if (currentOperation == "Update Sort ID")
                //{
                //    Global_Log.playlistAudio = PlaylistAudio;

                //    Sorting sorting = new Sorting();
                //    sorting.ShowDialog();
                //}
                else if (currentOperation == "Update")
                {
                    Track_Metadata addMusic = new Track_Metadata();
                    addMusic.updateSong();
                }
            }
            loadPlaylistSong(PlaylistAudio.SortId, PlaylistAudio.PID);
            Playlist_picker_SelectionChanged(null, null);
        }