コード例 #1
0
        private void Image_Tapped_1(object sender, TappedRoutedEventArgs e)
        {
            bool     hell = false;
            CollSort temp = new CollSort();

            foreach (CollSort l in myList)
            {
                if (l.BookId == selected)
                {
                    temp = l;
                    hell = true;
                    break;
                }
            }
            if (hell)
            {
                int i = myList.IndexOf(temp);
                if (i != myList.Count - 1)
                {
                    myList.Remove(temp);
                    i++;
                    myList.Insert(i, temp);
                }
                View.DataContext = myList;
            }
        }
コード例 #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            StorageFolder folder     = Windows.Storage.ApplicationData.Current.LocalFolder;
            StorageFile   sampleFile = await folder.GetFileAsync("sample.txt");

            testlol = await Windows.Storage.FileIO.ReadTextAsync(sampleFile);

            myList = new ObservableCollection <CollSort>();
            foreach (MeriCollection d in App.mc)
            {
                CollSort c = new CollSort();
                c.BookId    = d.BookId;
                c.BookName  = d.BookName;
                c.ChapterId = d.ChapterId;
                c.ChapterNo = d.ChapterNo;
                c.UserName  = d.UserName;
                c.sel       = false;
                myList.Insert(0, c);
            }
            View.ItemsSource          = myList;
            myList.CollectionChanged += MyList_CollectionChanged;
        }