コード例 #1
0
        private void UpdateManifestation_Click(object sender, RoutedEventArgs e)
        {
            Database.getInstance().SelectedManifestation = ClickedManifestation;
            EditManifestacija edit = new EditManifestacija();

            edit.Show();
        }
コード例 #2
0
        //DRAG AND DROP

        private void Map_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Point mousePosition = e.GetPosition(Map);

            ClickedManifestation = Manifestation_Click((int)mousePosition.X, (int)mousePosition.Y);
            if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2)
            {
                if (ClickedManifestation != null)
                {
                    Database.getInstance().SelectedManifestation = ClickedManifestation;
                    EditManifestacija edit = new EditManifestacija();
                    edit.Show();
                }
            }
        }
コード例 #3
0
        private void ManifestationPins_Draw()
        {
            Map.Children.Clear();
            foreach (Manifestacija manifestation in model.Manifestacije)
            {
                if (manifestation.X != -1 && manifestation.Y != -1 && manifestation.X != 0 && manifestation.Y != 0)
                {
                    Image ManifestationIcon = new Image();
                    ManifestationIcon.Width   = 70;
                    ManifestationIcon.Height  = 70;
                    ManifestationIcon.ToolTip = manifestation.Id + " " + manifestation.Name;

                    if (File.Exists(manifestation.IconPath))
                    {
                        ManifestationIcon.Source = new BitmapImage(new Uri(manifestation.IconPath, UriKind.Absolute));
                    }
                    else
                    {
                        MessageBox.Show("Došlo je do greške pri učitavanju ikonice manifestacije, molimo dodajte novu ikonicu!", "Došlo je do greške!");
                        Database.getInstance().SelectedManifestation = ClickedManifestation;
                        EditManifestacija edit = new EditManifestacija();
                        edit.Show();
                        break;
                    }

                    Map.Children.Add(ManifestationIcon);

                    Canvas.SetLeft(ManifestationIcon, manifestation.X);
                    Canvas.SetTop(ManifestationIcon, manifestation.Y);
                }
            }

            // To scroll down in list, for easier drag and dropping recent item
            if (listView != null && listView.Items.Count != 0)
            {
                listView.ScrollIntoView(listView.Items.GetItemAt(listView.Items.Count - 1));
            }
        }
コード例 #4
0
        public void EditClickManifestacija(object parameter)
        {
            //ubacujemo selektovanu manifestaciju kako bi drugi prozor mogao da vidi koja je to manifestacija
            Database.getInstance().SelectedManifestation = selektovanaManifestacija;
            //ubacujemo etikete nase selektovane manifestacije u etikete u bazi podataka, kako bi drugi prozor mogao videti
            Database.getInstance().EtiketeZaManifestaciju.Clear();
            foreach (Etiketa item in SelektovanaManifestacija.Etikete)
            {
                Database.getInstance().EtiketeZaManifestaciju.Add(item);
            }


            EditManifestacija manifestacija = new EditManifestacija();

            manifestacija.ShowDialog();

            manifestacije.Clear();
            foreach (Manifestacija item in Database.getInstance().Manifestations)
            {
                manifestacije.Add(item);
            }
            //  PretragaManifestacija();
        }