예제 #1
0
 private void SearchButton_Click(object sender, RoutedEventArgs e)
 {
     SearchResultNameTextBox.Text = "";
     if (SearchTextBox.Text.Count() > 0)
     {
         var FoundLoaction = Geocoding.GetLocation(SearchTextBox.Text);
         if (FoundLoaction != null)
         {
             SearchResultTextBlock.Text = "Znaleziono lokalizację\n";
             Hyperlink link     = new Hyperlink();
             var       filename = MapGenerator.CreateAndSave(FoundLoaction);
             link.NavigateUri      = new Uri(filename);
             link.RequestNavigate += Link_RequestNavigate;
             link.Inlines.Add("Sprawdź miejsce na mapie");
             SearchResultTextBlock.Inlines.Add(link);
             SearchResultNameTextBox.Text = FoundLoaction.Name;
             this.FoundLocation           = FoundLoaction;
             SearchResultNameTextBox.Focus();
         }
         else
         {
             SearchResultTextBlock.Text = "Brak Rezultatów";
             this.FoundLocation         = null;
         }
     }
 }
예제 #2
0
        private void UpdateTextBoxes(Location location)
        {
            NameTextBox.Text           = location.Name;
            UpdateCheckBox.IsChecked   = location.Update;
            LocationXTextBox.Text      = location.X.ToString();
            LocationYTextBox.Text      = location.Y.ToString();
            LocationETextBox.Text      = Math.Round(CurrentCoordinate.Latitude, 2).ToString();
            LocationNTextBox.Text      = Math.Round(CurrentCoordinate.Longitude, 2).ToString();
            ShowLocationTextBlock.Text = "";
            Hyperlink link     = new Hyperlink();
            var       filename = MapGenerator.CreateAndSave(location);

            link.NavigateUri      = new Uri(filename);
            link.RequestNavigate += Link_RequestNavigate;
            link.Inlines.Add("Sprawdź miejsce na mapie");
            ShowLocationTextBlock.Inlines.Add(link);
        }