void BeginInitializeDataSource()
 {
     personCollection = new XPCollection <Person>(uow);
     personCollection.BindingBehavior      = CollectionBindingBehavior.AllowRemove | CollectionBindingBehavior.AllowNew;
     personCollection.DeleteObjectOnRemove = true;
     personCollection.LoadAsync(EndInitializeDataSource);
 }
        private void LoadTargets()
        {
            if (_uow == null)
            {
                _uow     = new UnitOfWork();
                _targets = new XPCollection <TargetPerson>(_uow);
            }

            _targets.LoadAsync(LoadTargetCallBack);
        }
        void BeginInitializeDataSource()
        {
            UnitOfWork uow = new UnitOfWork();
            XPCollection <Appointments> appointments = new XPCollection <Appointments>(uow);

            appointments.DeleteObjectOnRemove = true;
            XPCollection <DXSample.DataObjects.Resources> resources = new XPCollection <DXSample.DataObjects.Resources>(uow);

            resources.DeleteObjectOnRemove = true;
            appointments.LoadAsync();
            resources.LoadAsync();
            this.DataContext = new CollectionsContainer()
            {
                Appointments = appointments, Resources = resources, UOW = uow
            };
        }
        public virtual void Search()
        {
            isSearchingCore = true;
            if (Criteria.Operands.Contains(EmptyCollectionCriteria))
            {
                Criteria.Operands.Remove(EmptyCollectionCriteria);
            }
            SearchStartEventArgs args = new SearchStartEventArgs(Criteria);

            OnSearchStart(args);
            if (!args.Cancel)
            {
                searchResultsCore.SuspendChangedEvents();
                searchResultsCore.Criteria = args.Criteria;
                searchResultsCore.LoadAsync(LoadSearchResultsCallback);
            }
        }
Example #5
0
        private void btnCommitTransactionAsync_Click(object sender, System.EventArgs e)
        {
            Modify();

            int
                param1 = 13,
                param2 = 14;

            AsyncCommitCallback commitCallback = exception =>
            {
                Debug.WriteLine($"commitCallback({exception?.Message ?? "null"}) {{ param1 = {param1}; param2 = {param2}; }}");
            };

            param2 *= 2;

            _unitOfWork.CommitChangesAsync(commitCallback);

            var collectionOfTestDE = new XPCollection <TestDE>(_unitOfWork);

            collectionOfTestDE.LoadAsync(LoadObjectsCallback);
        }