예제 #1
0
        void UpdateCar2GoLayer(Car2Go car2Go)
        {
            var car2GoCarsBrush = new SolidColorBrush(new Color {
                A = 255, R = 0, G = 159, B = 228,
            });
            var centerLocation = map.Center;

            car2goCarsLayer.Children.Clear();
            foreach (var car in car2Go.Markers)
            {
                try {
                    var distanceToMapCenter = (int)car.position.GetDistanceTo(centerLocation);

                    if (markersMaxDistance < distanceToMapCenter)
                    {
                        continue;
                    }
                    var pushpinContent = new Border {
                        Child = new StackPanel {
                            Orientation = System.Windows.Controls.Orientation.Vertical,
                            Children    =
                            {
                                new TextBlock         {
                                    Text = car.model,
                                },
                                new TextBlock         {
                                    Text = car.licensePlate,
                                },
                                new StackPanel        {
                                    Orientation = System.Windows.Controls.Orientation.Horizontal,
                                    Children    =
                                    {
                                        new Image     {
                                            Source = new BitmapImage
                                                         (new Uri((car.model.IndexOf("Electric") < 0)
                                                                                                        ? "/Resources/fuel28x28.png"
                                                                                                        : "/Resources/battery28x28.png", UriKind.Relative)),
                                            Margin = new Thickness(0, 0, 12, 0),
                                        },
                                        new TextBlock {
                                            Text = car.fuelState + "%",
                                        },
                                    },
                                },
                            },
                        },
                        Visibility = Visibility.Collapsed,
                    };
                    var pushpin = new Pushpin {
                        Location   = car.position,
                        Background = car2GoCarsBrush,
                        Opacity    = .6,
                        Content    = pushpinContent,
                        Tag        = car,
                    };
                    car2goCarsLayer.Children.Add(pushpin);
                    pushpin.Tap += OnPushpinTap;
                } catch { }
            }
        }
예제 #2
0
        // Code to execute when the application is launching (eg, from Start)
        // This code will not execute when the application is reactivated
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            ValidateTrialMode();
            var multicity = new Multicity();

            multicity.Updated += OnLayerUpdated;
            multicity.LoadPOIs();
            this.Resources.Add("multicity", multicity);

            var driveNow = new DriveNow();

            driveNow.Updated += OnLayerUpdated;
            driveNow.LoadPOIs();
            this.Resources.Add("driveNow", driveNow);

            var car2Go = new Car2Go();

            car2Go.Updated += OnLayerUpdated;
            car2Go.LoadPOIs();
            this.Resources.Add("car2go", car2Go);
            StartFlurry();
            UpdateFlipTile(
                "", "FreeCars", "\n     car2go\n   DriveNow\n    multicity", "Find free rides around you - car2go, DriveNow, multicity", 0,
                new Uri("/", UriKind.Relative),
                null,                 //new Uri("/ApplicationIcon.png", UriKind.Relative),
                null,
                null,
                new Uri("/Resources/wide_back_tile.png", UriKind.Relative),
                null);

            var currentVersion = GetAppAttribute("Version");
            var lastAppVersion = (string)GetAppSetting("last_version");

            if (null != lastAppVersion && lastAppVersion == currentVersion)
            {
                IsFirstLaunch = false;
            }
            else
            {
                IsFirstLaunch = true;
            }
            SetAppSetting("last_version", currentVersion);
        }
예제 #3
0
        // Code to execute when the application is launching (eg, from Start)
        // This code will not execute when the application is reactivated
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            ValidateTrialMode();
            var multicity = new Multicity();
            multicity.Updated += OnLayerUpdated;
            multicity.LoadPOIs();
            this.Resources.Add("multicity", multicity);

            var driveNow = new DriveNow();
            driveNow.Updated += OnLayerUpdated;
            driveNow.LoadPOIs();
            this.Resources.Add("driveNow", driveNow);

            var car2Go = new Car2Go();
            car2Go.Updated += OnLayerUpdated;
            car2Go.LoadPOIs();
            this.Resources.Add("car2go", car2Go);
            StartFlurry();
            UpdateFlipTile(
                "", "FreeCars", "\n     car2go\n   DriveNow\n    multicity", "Find free rides around you - car2go, DriveNow, multicity", 0,
                new Uri("/", UriKind.Relative),
                null, //new Uri("/ApplicationIcon.png", UriKind.Relative),
                null,
                null,
                new Uri("/Resources/wide_back_tile.png", UriKind.Relative),
                null);

            var currentVersion = GetAppAttribute("Version");
            var lastAppVersion = (string)GetAppSetting("last_version");
            if (null != lastAppVersion && lastAppVersion == currentVersion) {
                IsFirstLaunch = false;
            } else {
                IsFirstLaunch = true;
            }
            SetAppSetting("last_version", currentVersion);
        }