ReactiveUI: The Book #391

Merged
merged 64 commits into from Sep 15, 2014

Conversation

Projects
None yet
Owner

paulcbetts commented Nov 3, 2013

This massive PR is the :shipit: PR for the new version of the ReactiveUI documentation. This documentation is intended to be a comprehensive usage guide / reference for the library.

TODO:

[ ]   ├── getting-started.md
[ ]   ├── library-overview.md
[X]   ├── migrating-from-rxui4.md
[ ]   ├── overview.md
[ ]   ├── rac-info.md

      ├── advanced
[ ]   │   ├── act-on-every-object.md
[ ]   │   ├── autopersist.md
[ ]   │   ├── create-derived-collection.md
[ ]   │   ├── handle-observable-errors.md
[ ]   │   ├── index.md
[ ]   │   ├── memoizing-mru-cache.md
[ ]   │   ├── orderedcomparer.md
[ ]   │   ├── property-binding-continued.md
[ ]   │   ├── reflection-utils.md
[ ]   │   ├── serialization.md
[ ]   │   ├── suspension-host.md
[ ]   │   ├── testing.md
[ ]   │   └── when-navigated-to.md

      ├── android
[ ]   │   ├── activities-and-fragments.md
[ ]   │   ├── initialization.md
[ ]   │   └── platform-info.md

      ├── basics
[X]   │   ├── binding.md
[X]   │   ├── create-derived-collection.md
[X]   │   ├── dependency-resolution.md
[X]   │   ├── errors.md
[ ]   │   ├── index.md
[X]   │   ├── logging.md
[X]   │   ├── messagebus.md
[X]   │   ├── reactive-command-async.md
[X]   │   ├── reactive-command.md
[X]   │   ├── reactive-list.md
[X]   │   ├── reactive-object.md
[ ]   │   ├── routing.md
[ ]   │   ├── rx-cocoa-delegates.md
[ ]   │   ├── rx-events.md
[ ]   │   ├── schedulers.md
[ ]   │   ├── testing.md
[ ]   │   ├── to-property.md
[ ]   │   ├── unit-test-detection.md
[ ]   │   ├── view-location.md
[ ]   │   └── whenany.md

      ├── cocoa
[ ]   │   ├── initialization.md
[ ]   │   ├── kvo-observation.md
[ ]   │   ├── platform-info.md
[ ]   │   ├── reactive-view-controllers.md
[ ]   │   └── reactivetableviewsource.md

      ├── customization
[ ]   │   ├── binding-type-converters.md
[ ]   │   ├── creates-command-binding.md
[ ]   │   ├── creates-observable-for-property.md
[ ]   │   ├── dependency-resolution.md
[ ]   │   ├── index.md
[ ]   │   ├── registrable-interfaces.md
[ ]   │   └── startup.md

      └── xaml
[ ]       ├── auto-data-template.md
[ ]       ├── booleantovisibilitytypeconverter.md
[ ]       ├── platform-info.md
[ ]       └── transitioning-content-control.md
Member

jlaanstra commented Nov 4, 2013

I've used the MessageBus a couple of times for a ListPage <-> DetailPage scenario where I put the selected item on the MessageBus. Is that a use case we should mention for the MessageBus?

Yeah it works really well but I always get the feeling I'm just using
global variables with a fancy facade. With master detail you can create two
models. The master model is a reactive list + the selected index and the
detail model has a property that you bind to the selected item of the
master model. You could do this binding through a message bus but if you
create both the master view model and detail view model together it's
pretty easy to bind them together without a message bus.

I've used both message bus and direct binding and it works well either way.
On 04/11/2013 9:25 PM, "Johan Laanstra" notifications@github.com wrote:

I've used the MessageBus a couple of times for a ListPage <-> DetailPage
scenario where I put the selected item on the MessageBus. Is that a use
case we should mention for the MessageBus?


Reply to this email directly or view it on GitHubhttps://github.com/reactiveui/ReactiveUI/pull/391#issuecomment-27719430
.

AFAICS, there is no InvokeCommand extension method with this signature. Am I missing something?

Owner

paulcbetts replied Nov 15, 2013

I just added it, probably not in any release yet:

public static IDisposable InvokeCommand<T, TTarget>(this IObservable<T> This, TTarget target, Expression<Func<TTarget, ICommand>> commandProperty)

+```
+
+If you really need to control how things are logged, you can implement
+`IFullLogger`, which will allow you to control every logging overload.
@npnelson

npnelson Nov 27, 2013

Contributor

I'm not sure if anyone would find this useful (or worthy of a pull request for the docs), but I recently started using the ReactiveUI NLog package in my unit tests to write to the trace listener which then shows up in Visual Studio's Intellitrace. I find it pretty helpful, especially as a beginner. Here are the steps:

  1. Modify Visual Studio's IntelliTrace settings Debug>IntelliTrace>Open IntelliTrace Settings>IntelliTrace Events>Tracing> Check everything except Assertion under tracing. Under the default settings, you won't pick up Debug level tracing - by checking all of the Trace events, you will pick up Debug level messages.

  2. Make sure you have the reactiveui-nlog package installed to your unit test assembly (sorry, you are out of luck if you are using a Windows Store Test Library, but a "normal" unit test library works fine)

  3. Add a file called nlog.config to your unit test project. Make sure you set the "copy to output directory" property to "Copy if newer" or "Copy always" If you leave the default action of "Do not copy" then the nlog.config file won't be copied to your bin directory and nlog won't be able to find its config file, which means it won't know to write to the trace listener.

  4. Here is the nlog.config file

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <targets>
    <target name="trace" xsi:type="trace"  layout="RxUI:${message}"/>
  </targets>
  <rules>
    <logger name="*"  writeTo="trace" />
  </rules>
</nlog>
  1. Register NLogger at the start of your unit test with:
var logManager = RxApp.MutableResolver.GetService<ILogManager>();
RxApp.MutableResolver.RegisterConstant(logManager.GetLogger<NLogLogger>(),typeof(IFullLogger));   
@paulcbetts

paulcbetts Nov 27, 2013

Owner

@npnelson Yes! Can you submit a PR to the docs branch that contains this information?

Should this be

public DocumentViewModel : ReactiveObject

?

If not; Why?

Owner

paulcbetts replied Jan 9, 2014

Yes, this is a typo. Good catch!

Will this track nested properties as well?

class child : ReactiveObject {
   public bool IsDirty { .... }
}

class parent : ReactiveObject {
   public bool IsDirty {  ...  }
   public child child { .... }
}

class viewmodel : ReactiveObject {
    public ReactiveList<parent> parents { ... }

    public viewmodel() {
       parents = new ReactiveList<Parent>() { ChangeTrackingEnabled = True };
       parents.ItemChanged.Where(x => x.PropertyName == "IsDirty").Subscribe( ... );

       parents.First().Child.IsDirty = true;  // <-- will this fire ItemChanged ?
    }
}
Owner

paulcbetts replied Jan 9, 2014

No, it only tracks one level of changes. This is good to add as a note.

Seems to be a , to much there...

Owner

paulcbetts replied Jan 10, 2014

Yep, I always write a comma after every item, even the last one. Try it! :)

arlair commented Aug 31, 2014

Hi, this is just some info from someone trying to learn ReactiveUI :).

I was wondering why the doc branch is not kept in sync with master and the latest documentation not stored with each release? Via a link Paul posted on StackOverflow, I stumbled upon this treasure trove of information. I'm pretty sure that originally (weeks before I found this page) I went to:

https://github.com/reactiveui/ReactiveUI/tree/master/docs

and found it pretty empty and figured that was it. I realise the documentation is not complete yet, and sometimes out of date, but it definitely helped me a lot when piecing it together with other sources found on the web.

If that is not possible (I'm also a bit of a Git noob ;), it might be nice to link to the doc branch somewhere highly visible on Github and maybe reactiveui.net.

Thanks for the great work on ReactiveUI. After being a bit scared off at my lack of Reactive Extensions knowledge and finding it hard to figure out ReactiveUI, I came back and have been putting in a bigger effort to merge all the events in my head together.

Contributor

shiftkey commented Aug 31, 2014

I was wondering why the doc branch is not kept in sync with master and the latest documentation not stored with each release?

It was something that was started before the major release shipped. It'd be great to keep them in sync, but getting them completed is the first headache to solve.

it might be nice to link to the doc branch somewhere highly visible on Github and maybe reactiveui.net.

Yeah, I think this is much easier to do once we get this merged in. See also #574 for making the website better.

Is there any way to have a look at this in a complete view? Or even better, merge parts of it already? The documentation as it is right now is nearly completely deprecated isn't it? I tried to spin up from samples and got lost in translation.
Any suggestions on how to help out maybe?

ljani commented Sep 14, 2014

@kjellski See or checkout the docs branch for "a complete view", I'm not sure how complete it's though :)

@paulcbetts paulcbetts merged commit e213fa7 into master Sep 15, 2014

👍 thanks a lot! :) great progress already!

Member

jlaanstra commented Sep 15, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment