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(); } }
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(); } } }