Example #1
0
 private void NewLandmark_OnClick(object sender, RoutedEventArgs e)
 {
     if (lw == null)
     {
         lw = new LandmarkWindow(map);
         lw.Show();
     }
     else
     {
         lw.Topmost = true;  // important
         lw.Topmost = false; // important
         lw.Focus();         // important
     }
 }
        private void Double_OnClick(object sender, MouseButtonEventArgs e)
        {
            if (lw == null)
            {
                lw = new LandmarkWindow(m, this);
                lw.Show();
                Landmark l = (Landmark)dgrLandmarks.SelectedItem;
                lw.tempPosition           = l.position;
                copy                      = l;
                lw.ID_Field.Text          = l.ID;
                lw.Name_Field.Text        = l.Name;
                lw.Description_Field.Text = l.Description;
                lw.ChosenType             = l.Type;

                if (l.Type != null)
                {
                    lw.Chosen_landmark_type.Text = l.Type.TypeView;
                }
                else
                {
                    lw.Chosen_landmark_type.Text = "";
                }

                lw.Climate_Field.SelectedItem       = l.Climate;
                lw.TouristStatus_Field.SelectedItem = l.TStatus;
                lw.AnnualRevenue_Field.Text         = l.Revenue.ToString();
                lw.DateDiscovery.SelectedDate       = DateTime.Parse(l.DoD);
                lw.Tags_Field.Text     = l.TagView;
                lw.tags                = l.getTags();
                lw.Image_Path          = l.imagePath;
                lw.Eco.IsChecked       = l.EE;
                lw.Danger.IsChecked    = l.HAB;
                lw.Habitated.IsChecked = l.URB;
            }
            else
            {
                lw.Topmost = true;  // important
                lw.Topmost = false; // important
                lw.Focus();         // important
            }
        }