コード例 #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            //Loading.Visibility = Visibility.Visible;


            string id = e.Parameter as string;

            items1 = await Table1.Where(s => s.Id == id).ToCollectionAsync();

            if (items1 != null)
            {
                Scrap    s   = items1[0];
                string[] str = s.Point_List.Split(',');
                for (int i = 0; i < str.Length; i++)
                {
                    string po = str[i];
                    items2 = await Table2.Where(t => t.Id == po).ToCollectionAsync();

                    Pointer p = new Pointer();
                    if (items2.Count > 0)
                    {
                        p = items2[0];
                        li.Add(p);
                    }
                }
            }
            await StartPreviewAsync();

            for (int i = 0; i < li.Count; i++)
            {
                PointerViewAR p = new PointerViewAR();
                p.Id    = li[i].Id;
                p.lat   = li[i].lat;
                p.lon   = li[i].lon;
                p.Pitch = li[i].Pitch;
                p.Title = li[i].Title;
                p.Yaw   = li[i].Yaw;
                p.Desc  = li[i].Desc;
                p.Media = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(li[i].Media_Url));
                li2.Add(p);
            }

            myBool = true;
        }
コード例 #2
0
        private async Task loadPoint()
        {
            //TODO Flush older scrapes
            Tags.Text = "Loading Tour";
            myBool    = false;
            Scrap s = li[i];

            string[] str = s.Point_List.Split(',');
            for (int i = 0; i < str.Length; i++)
            {
                string po = str[i];
                items2 = await Table2.Where(t => t.Id == po).ToCollectionAsync();

                Pointer p = new Pointer();
                if (items2.Count > 0)
                {
                    p = items2[0];
                    li3.Add(p);
                }
            }//all pointers loaded for one scrap
            for (int i = 0; i < li3.Count; i++)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    PointerViewAR p = new PointerViewAR();
                    p.Id            = li3[i].Id;
                    p.lat           = li3[i].lat;
                    p.lon           = li3[i].lon;
                    p.Pitch         = li3[i].Pitch;
                    p.Title         = li3[i].Title;
                    p.Yaw           = li3[i].Yaw;
                    p.Desc          = li3[i].Desc;
                    p.Media         = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(li3[i].Media_Url));
                    li2.Add(p);
                });
            }
            //all images loaded
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Tags.Text = "Destination is " + li[i].Title;
            });

            myBool = true;
        }