コード例 #1
0
 private void Slika_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2)
     {
         Image  img  = (Image)sender;
         string ozn  = img.Name.Substring(7);
         var    Prik = new Spomenik.PrikazSpomMapa(ozn);
         Prik.ShowDialog();
     }
 }
コード例 #2
0
        private void PrikazeMn_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi = sender as MenuItem;

            if (mi != null)
            {
                Image img = ((ContextMenu)mi.Parent).PlacementTarget as Image;

                if (img != null)
                {
                    string oznaka = img.Name.Substring(7);
                    var    Prik   = new Spomenik.PrikazSpomMapa(oznaka);
                    Prik.ShowDialog();
                }
            }
        }