Beispiel #1
0
        private void ObjectDataSource_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.IsInDesignTool)
            {
                return;
            }

            // Load event will fire when return to page during navigation.
            if (_controlLoaded)
            {
                return;
            }

            // Initialize ControlParameters in descriptors now.
            SortDescriptors.ForEach(s => s.Initialize(this, this.Culture));
            FilterDescriptors.ForEach(f => f.Initialize(this, this.Culture));
            GroupDescriptors.ForEach(g => g.Initialize(this, this.Culture));

            // We have to listen for changes.
            SortDescriptors.CollectionChanged   += SortDescriptors_CollectionChanged;
            SortDescriptors.ItemChanged         += SortDescriptors_ItemChanged;
            FilterDescriptors.ItemChanged       += FilterDescriptors_ItemChanged;
            FilterDescriptors.CollectionChanged += FilterDescriptors_CollectionChanged;
            GroupDescriptors.ItemChanged        += GroupDescriptors_ItemChanged;
            GroupDescriptors.CollectionChanged  += GroupDescriptors_CollectionChanged;

            if (AutoLoad)
            {
                LoadCore();
            }
            _controlLoaded = true;
        }
        private void CalculateAggregates()
        {
            if (aggregatesAreCalculated || bindingContext.EnableCustomBinding)
            {
                return;
            }

            if (bindingContext.DataSource == null)
            {
                aggregatesAreCalculated = true;
                return;
            }

            if (Aggregates.Any())
            {
                var dataSource = GetCustomDataSource(bindingContext.DataSource).AsQueryable();

                var source = dataSource;
                if (FilterDescriptors.Any())
                {
                    source = dataSource.Where(FilterDescriptors);
                }
                aggregatesResults       = source.Aggregate(Aggregates);
                aggregatesAreCalculated = true;
            }
        }
Beispiel #3
0
        public BillAllocateManageVM()
        {
            var ipds = ItemPropertyDefinitions as List <ItemPropertyDefinition>;

            ipds.RemoveAll(o => o.PropertyName == "Status");
            //ipds.RemoveRange(0, 2);
            FilterDescriptors.RemoveAt(1);

            this.Entities = SearchData();
        }