Exemplo n.º 1
0
 private void Model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (_skipNext)
     {
         return;
     }
     switch (e.PropertyName)
     {
     case nameof(Model.Latitude):
     case nameof(Model.Longitude):
         var pair = new GeoTagsEntry(Model.Latitude, Model.Longitude);
         if (!pair.IsEmptyOrInvalid)
         {
             MapWebBrowser.Execute(@"moveTo", $@"{pair.LatitudeValue};{pair.LongitudeValue}");
         }
         break;
     }
 }
Exemplo n.º 2
0
        public TrackGeoTagsDialog(TrackObjectBase track)
        {
            DataContext = new ViewModel(track);
            InitializeComponent();

            Buttons = new[] {
                CreateExtraDialogButton(ToolsStrings.TrackGeoTags_FindIt, new DelegateCommand(() => {
                    MapWebBrowser.Execute(@"moveTo", GetQuery(Model.Track));
                })),
                CreateExtraDialogButton(FirstFloor.ModernUI.UiStrings.Ok, new CombinedCommand(Model.SaveCommand, CloseCommand)),
                CancelButton
            };

            MapWebBrowser.SetScriptProvider(new ScriptProvider(Model));
            MapWebBrowser.StartPage = GetMapAddress(track);

            Model.PropertyChanged += Model_PropertyChanged;
        }