protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // Start AR services
            ObservableCollection <ARItem> aritems = new ObservableCollection <ARItem>();

            foreach (var item in ViewModelLocator.MainStatic.Policemans.Current_distance_current_policemans_mapitems)
            {
                aritems.Add(item);
            }
            ;
            //aritems = new ObservableCollection<ARItem>();
            PolicemanMapItem item1 = new PolicemanMapItem()
            {
                Content     = "Тут",
                Lat         = ViewModelLocator.MainStatic.Latitued,
                Lon         = ViewModelLocator.MainStatic.Longitude,
                GeoLocation = new GeoCoordinate()
                {
                    Latitude = ViewModelLocator.MainStatic.Latitued, Longitude = ViewModelLocator.MainStatic.Longitude
                },
                Adress = ""
            };

            aritems.Add(item1);
            ARDisplay.ARItems = aritems;
            ARDisplay.StartServices();

            base.OnNavigatedTo(e);
        }
Beispiel #2
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // Start AR services
            Debug.WriteLine("Start AR services");
            Debug.WriteLine("isolatedStorage(long) is " + (String)(isolatedStorage["long"]));
            Debug.WriteLine("RunningServices is " + ARDisplay.ServicesRunning);
            if (!ARDisplay.ServicesRunning)
            {
                ARDisplay.StartServices();
            }
            HeadingIndicator.RotationSource = RotationSource.AttitudeHeading;
            //OverheadMap.RotationSource = RotationSource.AttitudeHeading;
            if (isolatedStorage.Contains("long") && !((String)(isolatedStorage["long"])).Equals(""))
            {
                GeoCoordinate spaceNeedleLocation = new GeoCoordinate(Double.Parse((String)(isolatedStorage["lat"])), Double.Parse((String)(isolatedStorage["long"])));
                ////GeoCoordinate spaceNeedleLocation = new GeoCoordinate(34.062201,-118.363947);
                //AddLabel(spaceNeedleLocation, "Car Location");

                ObservableCollection <ARItem> items = new ObservableCollection <ARItem>();
                RestaurantItem ri = new RestaurantItem()
                {
                    Cuisine     = "is here",
                    GeoLocation = spaceNeedleLocation,
                    Name        = "Your car is here",
                    Rating      = 9,
                };
                items.Add(ri);
                ARDisplay.ARItems = items;
                Debug.WriteLine("Added items to View");
            }
            base.OnNavigatedTo(e);
        }
Beispiel #3
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // Start AR services
            ARDisplay.StartServices();

            base.OnNavigatedTo(e);
        }
Beispiel #4
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            ARDisplay.StartServices();

            base.OnNavigatedTo(e);

            Settings_Init();

            if (e.NavigationMode == NavigationMode.New)
            {
                await Favourite_Init(true);
            }
            else
            {
                await Favourite_Init(false);
            }
        }
Beispiel #5
0
        public AR()
        {
            InitializeComponent();

            this.Loaded += (sender, e) =>
            {
                Init();

                ARDisplay.StartServices();

                //ARDisplay.PhotoCamera.Initialized += (sender2, e2) =>
                //{
                //  //ARDisplay.PhotoCamera.Resolution = ARDisplay.PhotoCamera.AvailableResolutions.Last();
                //};

                ARDisplay.Orientation = ControlOrientation.Clockwise270Degrees;

                ARInit(); // инициализируем дополненную реальность
            };
        }