当前位置: 首页>>代码示例>>C#>>正文


C# ReactiveList.EnableCollectionSynchronization方法代码示例

本文整理汇总了C#中ReactiveList.EnableCollectionSynchronization方法的典型用法代码示例。如果您正苦于以下问题:C# ReactiveList.EnableCollectionSynchronization方法的具体用法?C# ReactiveList.EnableCollectionSynchronization怎么用?C# ReactiveList.EnableCollectionSynchronization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReactiveList的用法示例。


在下文中一共展示了ReactiveList.EnableCollectionSynchronization方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LibraryGroupViewModel

        protected LibraryGroupViewModel(string header, string addHeader = null, string icon = null) {
            Header = header;
            AddHeader = addHeader;
            Icon = icon;
            if (!Execute.InDesignMode)
                this.SetCommand(x => x.AddCommand);

            Children = new ReactiveList<IHierarchicalLibraryItem>();
            IsExpanded = true;

            this.WhenAnyValue(x => x.SelectedItemsInternal)
                .Select(x => x == null ? null : x.CreateDerivedCollection(i => (IHierarchicalLibraryItem) i))
                .BindTo(this, x => x.SelectedItems);


            UiHelper.TryOnUiThread(() => {
                Children.EnableCollectionSynchronization(_childrenLock);
                _childrenView =
                    Children.CreateCollectionView(
                        new[] {
                            new SortDescription("SortOrder", ListSortDirection.Ascending),
                            new SortDescription("Model.IsFavorite", ListSortDirection.Descending),
                            new SortDescription("Model.Name", ListSortDirection.Ascending)
                        }, null,
                        null, null, true);
                _itemsView = _childrenView;
            });
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:28,代码来源:LibraryGroupViewModel.cs

示例2: PickCollectionViewModel

        public PickCollectionViewModel(IMediator mediator) {
            _mediator = mediator;
            Items = new ReactiveList<PickCollectionDataModel>();
            UiHelper.TryOnUiThread(() => {
                Items.EnableCollectionSynchronization(_itemsLock);
                ItemsView =
                    Items.CreateCollectionView(new List<SortDescription> {
                        new SortDescription("Name", ListSortDirection.Ascending)
                    }, null, new List<string> {"Name"}, OnFilter, true);
            });
            SelectedItems = new ReactiveList<PickCollectionDataModel>();

            this.WhenAnyValue(x => x.FilterText)
                .Throttle(Common.AppCommon.DefaultFilterDelay)
                .ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(x => ItemsView.TryRefreshIfHasView());

            this.SetCommand(x => x.OkCommand,
                this.WhenAnyValue(x => x.SelectedItems.Count).Select(x => x > 0), false)
                .RegisterAsyncTask(Process)
                .Subscribe();

            OkCommand.IsExecuting.Subscribe(x => IsExecuting = x);

            DisplayName = "Add mod to Collections";
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:26,代码来源:PickCollectionViewModel.cs


注:本文中的ReactiveList.EnableCollectionSynchronization方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。