void cmbRefType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var refTypeMapping = cmbRefType.SelectedItem as RefTypeMapping;

            gridSpecific.Children.Clear();
            if (refTypeMapping != null)
            {
                FrameworkElement control = null;
                switch (refTypeMapping.RefTypeCode)
                {
                case "J":
                    control = new JournalReferenceDetails(User);
                    break;

                case "JS":
                    control = new JournalSectionDetails(User);
                    break;

                case "B":
                    control = new BookDetails();
                    break;

                case "BS":
                    control = new BookSectionDetails();
                    break;

                case "M":
                    control = new MiscDetails();
                    break;

                case "U":
                    control = new InternetURLDetails();
                    break;
                }

                if (control != null)
                {
                    control.DataContext = _viewModel;
                    gridSpecific.Children.Add(control);
                }
            }
        }
Example #2
0
        void cmbRefType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var refTypeMapping = cmbRefType.SelectedItem as RefTypeMapping;
            gridSpecific.Children.Clear();
            if (refTypeMapping != null) {
                FrameworkElement control = null;
                switch (refTypeMapping.RefTypeCode) {
                    case "J":
                        control = new JournalReferenceDetails(User);
                        break;
                    case "JS":
                        control = new JournalSectionDetails(User);
                        break;
                    case "B":
                        control = new BookDetails();
                        break;
                    case "BS":
                        control = new BookSectionDetails();
                        break;
                    case "M":
                        control = new MiscDetails();
                        break;
                    case "U":
                        control = new InternetURLDetails();
                        break;
                }

                if (control != null) {
                    control.DataContext = _viewModel;
                    gridSpecific.Children.Add(control);
                }
            }
        }