小编Mik*_*yak的帖子

奇怪的动态数据排序

我认为 DynamicData 中的排序无法正常工作。可能是我不明白如何使用它?例子:

using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive;
using System.Reactive.Linq;

namespace DynamicDataTest
{
    public class Element:ReactiveObject
    {
        string name;
        public string Name { get => name; set => this.RaiseAndSetIfChanged(ref name,value); }
        int val;
        public int Value { get => val; set => this.RaiseAndSetIfChanged(ref val, value); }    
    }

    public class CollectionTest:ReactiveObject
    {
        public SourceCache<Element, int> source = new SourceCache<Element, int>(e => e.Value);
        public ReadOnlyObservableCollection<string> Info;
        public void Print()
        {
            Console.WriteLine("Begin …
Run Code Online (Sandbox Code Playgroud)

c# dynamic-data reactiveui

3
推荐指数
1
解决办法
1486
查看次数

标签 统计

c# ×1

dynamic-data ×1

reactiveui ×1