示例#1
0
        private void CancelAction(object sender, RoutedEventArgs e)
        {
            Button       button      = sender as Button;
            MainPageData dataContext = button.DataContext as MainPageData;

            this.ToggleWriteState();
        }
示例#2
0
        private void ChangeCategory(object sender, SelectionChangedEventArgs e)
        {
            ListView     listView = sender as ListView;
            int          selectedIndexCategory = listView.SelectedIndex;
            MainPageData dataContext           = listView.DataContext as MainPageData;

            dataContext.SetActivePrograms(selectedIndexCategory);
        }
示例#3
0
        private void SetChannelProgram(object sender, SelectionChangedEventArgs e)
        {
            ListView listview             = sender as ListView;
            int      selectedIndexProgram = listview.SelectedIndex;

            if (selectedIndexProgram != -1)
            {
                MainPageData dataContext = listview.DataContext as MainPageData;
                int          program     = dataContext.ActiveCategory.StartIndex + selectedIndexProgram;
                Debug.WriteLine("index: {0} - Program: {1}", program, dataContext.Programs.ElementAt(program));
            }
            Debug.WriteLine(selectedIndexProgram);
            Debug.WriteLine("Set Program");
        }
示例#4
0
        private void DeletePlaylist(object sender, RoutedEventArgs e)
        {
            Button       button       = sender as Button;
            MainPageData dataContext  = button.DataContext as MainPageData;
            var          selectedItem = PlaylistListView.SelectedItem;

            if (selectedItem != null)
            {
                PlaylistModel playlist = dataContext.GetPlaylist(selectedItem.ToString());
                if (playlist != null)
                {
                    dataContext.RemovePlayList(playlist);
                }
            }
        }
示例#5
0
        private void SetActivePlaylist(object sender, SelectionChangedEventArgs e)
        {
            ListView      listView     = sender as ListView;
            MainPageData  dataContext  = listView.DataContext as MainPageData;
            PlaylistModel selectedItem = listView.SelectedItem as PlaylistModel;

            if (selectedItem != null)
            {
                PlaylistModel playlist = dataContext.GetPlaylist(selectedItem.Name.ToString());
                if (playlist != null)
                {
                    dataContext.ChangePlaylist(playlist);
                }
            }
        }
示例#6
0
        private void AddPlaylist(object sender, RoutedEventArgs e)
        {
            Button       button       = sender as Button;
            MainPageData dataContext  = button.DataContext as MainPageData;
            string       playlistName = InputText.Text;

            if (!Utility.IsStringEmpty(playlistName))
            {
                Debug.WriteLine("Adding playlist");
                PlaylistModel playlist = new PlaylistModel(playlistName, new List <MidiFile>());
                dataContext.SetPlaylist(playlist);
                Debug.WriteLine("Actualizando dataContext");
                this.DataContext = dataContext;
            }
            this.ToggleWriteState();
            InputText.Text = string.Empty;
        }
示例#7
0
 private void EditPlaylist(object sender, RoutedEventArgs e)
 {
     Button       button      = sender as Button;
     MainPageData dataContext = button.DataContext as MainPageData;
 }