rolandpheasant / dynamicdata.reactiveui Goto Github PK
View Code? Open in Web Editor NEWAdaptors to integrate Dynamic Data with ReactiveUI
License: Microsoft Public License
Adaptors to integrate Dynamic Data with ReactiveUI
License: Microsoft Public License
This actually isn't your bug and it's pretty obscure, but RxUI has removed Move from reactivelist only on Silverlight, here (reactiveui/ReactiveUI@7224331). Don't ask me why. But this lib relies on it so obviously in many cases... boom.
In ceratain scenarios it is possible to get an index out of range exception.
This is produced when an operator follows a WhereReasonsAre filter
Under some circumstances, it happens that after Bind() the OnItemRemoved is not getting called.
I wasn't able to get any differences when it happens and when its working. (have two similar places I use it)
With ObservableCollectionExtended, everything work as expected.
var sc = new SourceCache<int, int>(i => i.GetHashCode());
var rl = new ReactiveList<int>();
sc.Connect()
.OnItemRemoved(model => Logger.Info("removed"))
.Bind(rl)
.OnItemRemoved(model => Logger.Info("removed after"))
.DisposeMany()
.Subscribe()
Maybe I'm not understanding the interaction of bind quite correctly but I'm seeing items from the source collection being duplicated into the destination ReactiveList.
When I bind to an ObservableCollectionExtended that behaves as I'd expect it to
[Test]
public void DuplicatingResult()
{
_source.Add(new Person("Adult1", 47));
_source.Add(new Person("Adult2", 48));
_source.Add(new Person("Adult3", 49));
_source.Add(new Person("Adult4", 150));
_source.Add(new Person("Adult5", 150));
_source.Add(new Person("Adult6", 150));
_source.Add(new Person("Adult7", 150));
_source.Add(new Person("Adult8", 150));
Subject<int> ageTofilter = new Subject<int>();
ObservableCollectionExtended<Person> nonReactiveListBinding = new ObservableCollectionExtended<Person>();
var passengerFilter =
ageTofilter
.Select(data =>
{
Func<Person, bool> filter = (twp) =>
{
return twp.Age == data;
};
return filter;
});
_source
.Connect()
.Filter(passengerFilter)
.Bind(nonReactiveListBinding)
.Bind(_collection)
.Subscribe();
//this passes
Assert.AreEqual(8, _collection.Count);
//Change the filter
ageTofilter.OnNext(150);
//this passes
Assert.AreEqual(5, nonReactiveListBinding.Count);
//this fails with a result of 13. Items are being duplicated
//into the reactivelist
Assert.AreEqual(5, _collection.Count);
}
I just discovered DynamicData and ReactiveUI (I know I am late to the party), wanted to use them, then found this repo but was disappointed to find it neglected.
I started going down the road of forking it and try porting or at least understanding it myself so I could salvage any useful concepts, only to hit a compile error and find ReactiveList was removed from ReactiveUI in favor of....DynamicData!
Here are some helpful links for other developers who might be on the same journey:
target file for nuspec is DynamicData.dll, instead of DD.RxUI.dll.
hint: only specify target folder to avoid this.
Also (strangely) the nupkg contains both DD.dll and DD.RxUI.dll, in different folders, probably not working well.
Cheers.
Can you please update DynamicData.ReactiveUI so that I can use the latest DynamicData 5 and ReactiveUI 7 versions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.