예제 #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            rec = new StoreListing();
            LoadingBar.Visibility      = Visibility.Visible;
            LoadingBar.IsIndeterminate = true;
            rec           = e.Parameter as StoreListing;
            Title.Text    = rec.Title;
            Cover.Source  = rec.Image;
            FullCost.Text = "Tour " + rec.Price;
            string[] ids = rec.MyId.Split(',');
            try
            {
                foreach (string nid in ids)
                {
                    if (nid != "")
                    {
                        recM  = new StoreListing();
                        items = await Table.Where(Scrap
                                                  => Scrap.Id == nid).ToCollectionAsync();

                        recM.Id    = items[0].Id;
                        recM.Title = items[0].Title;
                        recM.MyId  = items[0].Point_List;
                        recM.Image = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(this.BaseUri, "Assets/augmented-reality-for-blog.jpg")); // image fromasset store
                        sl.Add(recM);
                    }
                }
                StoreListView.DataContext = sl;
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
        private void StoreListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            StoreListing sent = e.ClickedItem as StoreListing;

            if (sent.Type == "S")
            {
                Frame.Navigate(typeof(ViewScrape), sent.Id);
            }
            else if (sent.Type == "D")
            {
                Frame.Navigate(typeof(Diary_Store_View_Page), sent);
            }
            else if (sent.Type == "T")
            {
                Frame.Navigate(typeof(Tour_Store_View_Page), sent);
            }
        }
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            rec = new StoreListing();
            LoadingBar.Visibility      = Visibility.Visible;
            LoadingBar.IsIndeterminate = true;
            rec           = e.Parameter as StoreListing;
            Title.Text    = rec.Title;
            Cover.Source  = rec.Image;
            FullCost.Text = "Diary " + rec.Price;
            string[] ids = rec.MyId.Split(',');
            try
            {
                foreach (string nid in ids)
                {
                    if (nid != "")
                    {
                        recM  = new StoreListing();
                        items = await Table.Where(Tour
                                                  => Tour.Id == nid).ToCollectionAsync();

                        recM.Id    = items[0].Id;
                        recM.Title = items[0].Title;
                        recM.MyId  = items[0].Scrap_List;
                        recM.Image = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(items[0].Cover_Url)); // image fromasset store
                        sl.Add(recM);
                    }
                }
                StoreListView.DataContext = sl;
                LoadingBar.Visibility     = Visibility.Collapsed;
            }
            catch (Exception)
            {
                MessageDialog msgbox = new MessageDialog("Sorry can't update now");
                await msgbox.ShowAsync();

                LoadingBar.Visibility = Visibility.Collapsed;
            }
        }
예제 #4
0
        private async void Store_Loaded(object sender, RoutedEventArgs e)
        {
            Tlist.Clear();
            Dlist.Clear();
            LoadingBar2.Visibility = Visibility.Visible;
            LoadingBar2.IsActive   = true;

            try
            {
                //items1 = await Table1.ToCollectionAsync();
                items2 = await Table2.ToCollectionAsync();

                items3 = await Table3.ToCollectionAsync();

                //foreach (Scrap si in items1)
                //{
                //    s = new StoreListing();
                //    s.Image = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(this.BaseUri, "Assets/augmented-reality-for-blog.jpg")); // some static iage for scrap
                //    s.Price = "Price: " + "Free";
                //    s.Title = si.Title;
                //    s.Id = si.Id;
                //    s.MyId = si.Point_List;
                //    s.Type = "S";
                //    Slist.Add(s);
                //}

                foreach (Tour si in items2)
                {
                    s        = new StoreListing();
                    s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                    s.Price  = "Price: " + si.Price.ToString();
                    s.Title  = si.Title;
                    s.MyId   = si.Scrap_List;
                    s.UserId = si.UserId;
                    s.Id     = si.Id;
                    s.Type   = "T";
                    Tlist.Add(s);
                }

                foreach (Diary si in items3)
                {
                    s        = new StoreListing();
                    s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                    s.Price  = "Price: " + si.Price.ToString();
                    s.Title  = si.Title;
                    s.Id     = si.Id;
                    s.UserId = si.UserId;
                    s.MyId   = si.Tour_List;
                    s.Type   = "D";
                    Dlist.Add(s);
                }
                LoadingBar2.IsActive   = false;
                LoadingBar2.Visibility = Visibility.Collapsed;
                DiaryView.DataContext  = Dlist;
                TourView.DataContext   = Tlist;
                //ScarpeView.DataContext = Slist;
            }
            catch (Exception)
            {
                MessageDialog msgbox = new MessageDialog("Sorry can't update now");
                await msgbox.ShowAsync();

                LoadingBar2.Visibility = Visibility.Collapsed;
            }
        }
예제 #5
0
        private async Task search_Func(string str1)
        {
            try
            {
                words = str1.Split(' ');
                LoadingBar2.Visibility = Visibility.Visible;
                LoadingBar2.IsActive   = true;
                Tlist.Clear();
                Dlist.Clear();
                items2 = await Table2.ToCollectionAsync();

                items3 = await Table3.ToCollectionAsync();

                foreach (Tour si in items2)
                {
                    foreach (string str in words)
                    {
                        if (si.Title.CaseInsensitiveContains(str))
                        {
                            s        = new StoreListing();
                            s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                            s.Price  = "Price: " + si.Price.ToString();
                            s.Title  = si.Title;
                            s.MyId   = si.Scrap_List;
                            s.UserId = si.UserId;
                            s.Id     = si.Id;
                            s.Type   = "T";
                            Tlist.Add(s);
                        }
                        else if (si.Tags != null && si.Tags.CaseInsensitiveContains(str))
                        {
                            s        = new StoreListing();
                            s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                            s.Price  = "Price: " + si.Price.ToString();
                            s.Title  = si.Title;
                            s.MyId   = si.Scrap_List;
                            s.UserId = si.UserId;
                            s.Id     = si.Id;
                            s.Type   = "T";
                            Tlist.Add(s);
                        }
                        else if (si.Desc != null && si.Desc.CaseInsensitiveContains(str))
                        {
                            s        = new StoreListing();
                            s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                            s.Price  = "Price: " + si.Price.ToString();
                            s.Title  = si.Title;
                            s.MyId   = si.Scrap_List;
                            s.UserId = si.UserId;
                            s.Id     = si.Id;
                            s.Type   = "T";
                            Tlist.Add(s);
                        }
                    }
                }
                foreach (Diary si in items3)
                {
                    foreach (string str in words)
                    {
                        if (si.Title.CaseInsensitiveContains(str))
                        {
                            s        = new StoreListing();
                            s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                            s.Price  = "Price: " + si.Price.ToString();
                            s.Title  = si.Title;
                            s.Id     = si.Id;
                            s.UserId = si.UserId;
                            s.MyId   = si.Tour_List;
                            s.Type   = "D";
                            Dlist.Add(s);
                        }
                        else if (si.Tags != null && si.Tags.CaseInsensitiveContains(str))
                        {
                            s        = new StoreListing();
                            s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                            s.Price  = "Price: " + si.Price.ToString();
                            s.Title  = si.Title;
                            s.Id     = si.Id;
                            s.UserId = si.UserId;
                            s.MyId   = si.Tour_List;
                            s.Type   = "D";
                            Dlist.Add(s);
                        }

                        else if (si.Desc != null && si.Desc.CaseInsensitiveContains(str))
                        {
                            s        = new StoreListing();
                            s.Image  = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(si.Cover_Url)); // some static iage for scrap
                            s.Price  = "Price: " + si.Price.ToString();
                            s.Title  = si.Title;
                            s.Id     = si.Id;
                            s.UserId = si.UserId;
                            s.MyId   = si.Tour_List;
                            s.Type   = "D";
                            Dlist.Add(s);
                        }
                    }
                }
                LoadingBar2.IsActive   = false;
                LoadingBar2.Visibility = Visibility.Collapsed;
                DiaryView.DataContext  = Dlist;
                TourView.DataContext   = Tlist;
            }
            catch (Exception)
            {
                MessageDialog msgbox = new MessageDialog("Sorry can't update now");
                await msgbox.ShowAsync();

                LoadingBar2.Visibility = Visibility.Collapsed;
            }
        }