Esempio n. 1
0
        private void ListViewItem_onClick(object sender, MouseButtonEventArgs e)
        {
            var item = sender as ListViewItem;

            if (item != null && item.IsSelected)
            {
                Therapy therapy = (Therapy)item.Content;
                //kad kliknem na lek da me pita da li zelim da obrisem
                // Configure the message box to be displayed
                string           messageBoxText = "Are you sure you want to remove therapy?";
                string           caption        = "";
                MessageBoxButton button         = MessageBoxButton.YesNo;

                // Display message box
                MessageBoxResult result = MessageBox.Show(messageBoxText, caption, button);

                // Process message box results
                switch (result)
                {
                case MessageBoxResult.Yes:
                    // Obrisi terapiju

                    therapyController.RemoveTherapy(therapy);

                    break;

                case MessageBoxResult.No:
                    break;
                }
                Therapies therapies = new Therapies();
                therapies.Show();
                this.Close();
            }
        }
Esempio n. 2
0
        private void therClick(object sender, RoutedEventArgs e)
        {
            Therapies therapy = new Therapies();

            therapy.Show();
            this.Close();
        }