Ejemplo n.º 1
0
        /// <summary>
        /// Removes the column-list and adds viewModels for the source's columns
        /// </summary>
        /// <param name="source"></param>
        private void RefreshColumns(SourceEditViewViewModel source)
        {
            if (Columns != null)
            {
                Columns.Clear();

                if (source != null)
                {
                    foreach (var column in source.Source.Columns)
                    {
                        Columns.Add(new ColumnEditViewViewModel(this, column, _validator));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public SourcesViewViewModel()
        {
            AddNewSourceCommand = new RelayCommand(() =>
            {
                var vm = new SourceEditViewViewModel()
                {
                    Source = new Source()
                };
                Sources.Add(vm);
                SelectedSourceEditViewViewModel = vm;
            });
            AddNewColumnCommand           = new RelayCommand(() => AddColumn());
            DeleteSelectedSourcesCommand  = new RelayCommand(() => Delete(Sources.Where(s => s.IsSelected)));
            DeletedSelectedColumnsCommand = new RelayCommand(() => Delete(Columns.Where(c => c.IsSelected)));

            DeleteSelectedValidationRulesCommand = new RelayCommand(() => SelectedColumn.DeleteSelectedValidationRules());
            AddMinMaxRuleCommand      = new RelayCommand(() => SelectedColumn.AddRule(new MinMaxRule()));
            AddComparisonRuleCommand  = new RelayCommand(() => SelectedColumn.AddRule(new ComparisonRule()));
            AddLikeRuleCommand        = new RelayCommand(() => SelectedColumn.AddRule(new LikeRule()));
            AddCustomQueryRuleCommand = new RelayCommand(() => SelectedColumn.AddRule(new CustomQueryRule()));
        }
Ejemplo n.º 3
0
 private void Delete(SourceEditViewViewModel source)
 {
     Sources.Remove(source);
 }