Esempio n. 1
0
        public EditFactorsViewer(EditFactorsViewModel efViewModel)
        {
            InitializeComponent();
            _efViewModel = efViewModel;

            _numFactors = efViewModel.ResearchFactors.Count;

            CreateGrid(_numFactors);
            buildTable(_numFactors);
        }
Esempio n. 2
0
        public AddFactorLabels(EditFactorsViewModel _efViewModel, int index)
        {
            InitializeComponent();
            try
            {
                if(_efViewModel.ResearchFactors[index].Labels == null)
                    _efViewModel.ResearchFactors[index].Labels = new ObservableCollection<string>();

                _labels = _efViewModel.ResearchFactors[index].Labels;
                Binding binding = new Binding("Labels") {Source = _efViewModel.ResearchFactors[index]};
                binding.Mode = BindingMode.TwoWay;
                labels_listView.SetBinding(ListView.ItemsSourceProperty, binding);

            }
            catch (IndexOutOfRangeException ex)
            {
                MessageBox.Show("Index for binding was out of range! " + ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("General exception: " + ex.Message);
            }
        }