예제 #1
0
        private void EditEvent_Click(object sender, RoutedEventArgs e)
        {
            DockPanel activePanel = GetSelectedItem(e);
            if (activePanel == null)
                return;

            int id;
            if (!int.TryParse(activePanel.Tag.ToString(), out id))
                return;

            MainEvent wndEvent = new MainEvent(id);
            if (wndEvent.ShowDialog() == true)
                UpdateCalendar();
        }
예제 #2
0
        private void btnCreateEvent_Click(object sender, RoutedEventArgs e)
        {
            MainEvent wndEvent = new MainEvent();
            wndEvent.ShowDialog();

            EventType eventType = cbEventTypes.SelectedItem as EventType;
            EventTypes eventTypes = new EventTypes();
            cbEventTypes.ItemsSource = eventTypes;
            if (eventType != null)
                cbEventTypes.SelectedItem = eventTypes.Where(item => item.TypeId == eventType.TypeId).FirstOrDefault();

            UpdateCalendar();
        }