protected override void OnInitialize()
        {
            base.OnInitialize();

            AddressSelector.Init();
            Env.RxQuery(s => s.Query <Supplier>().OrderBy(x => x.Name)
                        .ToList()
                        .Select(x => new Selectable <Supplier>(x)).ToList())
            .Subscribe(Suppliers);

            var supplierSelectionChanged = Suppliers.SelectMany(x => x?.Select(p => p.Changed()).Merge()
                                                                .Throttle(Consts.FilterUpdateTimeout, UiScheduler)
                                                                ?? Observable.Empty <EventPattern <PropertyChangedEventArgs> >());

            Begin.Changed()
            .Merge(End.Changed())
            .Merge(IsFilterByDocumentDate.Changed())
            .Merge(RejectFilter.Changed())
            .Merge(supplierSelectionChanged)
            .Merge(AddressSelector.FilterChanged)
            .Merge(TypeFilter.Changed())
            .Merge(Suppliers.Where(x => x != null).Cast <object>())
            .Merge(Bus.Listen <Waybill>())
            .Merge(DbReloadToken)
            .Throttle(TimeSpan.FromMilliseconds(50), Scheduler)
            .Subscribe(_ => Update(), CloseCancellation.Token);
        }
Пример #2
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            DbReloadToken
            .Merge(Begin.Changed())
            .Merge(End.Changed())
            .Merge(IsNotOverdue.Changed())
            .Merge(IsOverdue.Changed())
            .SelectMany(_ => RxQuery(LoadItems))
            .Subscribe(Items);
        }
Пример #3
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            RxQuery(CalcLinks).Subscribe(Link);

            Link.Changed()
            .Merge(Begin.Changed())
            .Merge(End.Changed())
            .Merge(IsPerhaps.Changed())
            .Merge(IsDefective.Changed())
            .SelectMany(_ => RxQuery(LoadItems))
            .Subscribe(Items);
        }