Пример #1
0
        private void Btn_FormatsAddFormat_Click(object sender, RoutedEventArgs e)
        {
            AddFormatDlg addFormat = new AddFormatDlg();

            addFormat.Closed += new EventHandler(FormatAddFormat_Close);
            addFormat.Show();
        }
Пример #2
0
        private void FormatAddFormat_Close(object sender, EventArgs e)
        {
            _FormatsTable           = _formatsModel.FormatTable;
            FormatsGrid.DataContext = _FormatsTable.DefaultView;
            FormatsGrid.Items.Refresh();

            AddFormatDlg addFormat = sender as AddFormatDlg;
            string       target    = addFormat.NewFormat;
            // TODO Select the new format
        }
Пример #3
0
        private void InitFormatSelection()
        {
            List <string> formats = ((App)Application.Current).Model.FormatTable.ListBoxSelectionList();

            LB_FormatSelector.DataContext = formats;
            if (formats.Count < 1)
            {
                string           mbMsg            = "There are no formats, would you like to add one?";
                MessageBoxResult messageBoxResult = MessageBox.Show(mbMsg, "Add Format Confirmation", MessageBoxButton.YesNo);
                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    AddFormatDlg AddformatControl = new AddFormatDlg();
                    AddformatControl.Show();
                    return;
                }
            }
            LB_FormatSelector.Items.Clear();
            foreach (string format in formats)
            {
                LB_FormatSelector.Items.Add(format);
            }
        }