Ejemplo n.º 1
0
        private async void Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            var       ChosenItem = (GroupedSearchResult)args.ChosenSuggestion;
            ItemModel NewItem    = new ItemModel();

            //fetch if it has local library
            var OffFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Offline_data", CreationCollisionOption.OpenIfExists);

            StorageFile OpenJSONFile = await OffFolder.GetFileAsync("RAW_1.json");

            string ReadJSONFile = await FileIO.ReadTextAsync(OpenJSONFile);

            try {
                NewItem = JsonConvert.DeserializeObject <List <ItemModel> >(ReadJSONFile)
                          .Where(x => x.Item_Id == ChosenItem.Library.Item_Id)
                          .First();
            }
            catch (InvalidOperationException) {
                NewItem = ChosenItem.Library;
            }
            //show expanditemdetails
            ExpandItemDetails ExpandItemDialog = new ExpandItemDetails();

            ExpandItemDialog.Item     = NewItem;
            ExpandItemDialog.category = (ChosenItem.GroupName == "Anime") ? AnimeOrManga.anime : AnimeOrManga.manga;
            await ExpandItemDialog.ShowAsync();
        }
Ejemplo n.º 2
0
        private async Task <ItemModel> lo(CollectionLibraryViewModel e)
        {
            ExpandItemDetails ExpandItemDialog = new ExpandItemDetails();
            ItemModel         item;

            ExpandItemDialog.Item     = e.Itemproperty;
            ExpandItemDialog.category = DirectoryDetail.AnimeOrManga;
            await ExpandItemDialog.ShowAsync();

            item = ExpandItemDialog.Item;
            return(item);
        }