コード例 #1
0
        // Options
        private void AddOption_OnClick(object sender, RoutedEventArgs e)
        {
            var optionDialog = new OptionDialog()
            {
                Owner = this
            };

            if (optionDialog.ShowDialog() != true)
            {
                return;
            }

            _openEvent.Options.Add(optionDialog.Option);
            OptionsListBox.SelectedItem = optionDialog.Option;
        }
コード例 #2
0
        private void EditOption_OnClick(object sender, RoutedEventArgs e)
        {
            if (!(OptionsListBox.SelectedItem is EventOption selectedObject))
            {
                return;
            }

            var optionDialog = new OptionDialog(selectedObject)
            {
                Owner = this
            };

            if (optionDialog.ShowDialog() != true)
            {
                return;
            }

            selectedObject.Description     = optionDialog.Option.Description;
            selectedObject.RequirementList = optionDialog.Option.RequirementList;
            selectedObject.ResultSets      = optionDialog.Option.ResultSets;

            OptionsListBox.Items.Refresh();
        }