<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thursday Night &#187; Uncategorized</title>
	<atom:link href="http://blog.paulbetts.org/index.php/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.paulbetts.org</link>
	<description>Paul Betts's personal website / blog / what-have-you</description>
	<lastBuildDate>Tue, 27 Sep 2011 21:17:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>SassAndCoffee 1.1 issues with AppHarbor</title>
		<link>http://blog.paulbetts.org/index.php/2011/09/27/sassandcoffee-1-1-issues-with-appharbor/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/09/27/sassandcoffee-1-1-issues-with-appharbor/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 21:17:59 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=787</guid>
		<description><![CDATA[SassAndCoffee 1.1 currently doesn&#8217;t work on AppHarbor, and returns a 502 Gateway Error on the site. I&#8217;m working with the AppHarbor folks to fix this as soon as I can. Sorry about this! The Details On startup, we write out the V8 DLL to a temporary directory and call Assembly.Load to load it. Unfortunately, even [...]]]></description>
			<content:encoded><![CDATA[<p>
SassAndCoffee 1.1 currently doesn&#8217;t work on AppHarbor, and returns a <b>502 Gateway Error</b> on the site. I&#8217;m working with the AppHarbor folks to fix this as soon as I can. Sorry about this!
</p>
<h2>The Details</h2>
<p>
On startup, <a href="https://github.com/xpaulbettsx/SassAndCoffee/blob/master/SassAndCoffee.Core/JavascriptInterop.cs#L170">we write out the V8 DLL to a temporary directory</a> and call Assembly.Load to load it. Unfortunately, even though the write succeeds, the Load fails for some reason. On AppHarbor, we would always fall back to Jurassic, but in 1.1 I disabled this fallback because of performance issues (and because it made it harder to debug the V8 load failures).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/09/27/sassandcoffee-1-1-issues-with-appharbor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ReactiveUI posts now in PDF format</title>
		<link>http://blog.paulbetts.org/index.php/2011/04/18/reactiveui-posts-now-in-pdf-format/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/04/18/reactiveui-posts-now-in-pdf-format/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 06:34:58 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=721</guid>
		<description><![CDATA[Since my blog software is rather lacking as an official document source for ReactiveUI, I&#8217;ve put together the blog posts in chronological order, cleaned them up, and compiled them into a single PDF, called &#8220;The Zen of ReactiveUI&#8221;. I&#8217;ve also created a version in ePub format, so that you can put it onto an eBook [...]]]></description>
			<content:encoded><![CDATA[<p>
Since my blog software is rather lacking as an official document source for ReactiveUI, I&#8217;ve put together the blog posts in chronological order, cleaned them up, and compiled them into a single PDF, called &#8220;The Zen of ReactiveUI&#8221;. I&#8217;ve also created a version in ePub format, so that you can put it onto an eBook reader. If you&#8217;re interested in either RxUI, or the Reactive Extensions in general, I think the PDF is a good read &#8211; it talks about not only how RxUI works, but a lot of interesting background behind how things work.
</p>
<p>
Get the document here:</p>
<ul>
<li><a href="http://www.reactiveui.net/welcome/pdf">PDF Format</a></li>
<li><a href="http://www.reactiveui.net/welcome/epub">ePub Format</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/04/18/reactiveui-posts-now-in-pdf-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Release: ReactiveUI 2.1</title>
		<link>http://blog.paulbetts.org/index.php/2011/02/14/new-release-reactiveui-2-1/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/02/14/new-release-reactiveui-2-1/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 03:39:32 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=686</guid>
		<description><![CDATA[What does ReactiveUI do? ReactiveUI is a M-V-VM framework like MVVM Light or Caliburn.Micro, that is deeply integrated with the Reactive Extensions for .NET. This allows you to write code in your ViewModel that is far more elegant and terse when expressing complex stateful interactions, as well as much simpler handling of async operations. Check [...]]]></description>
			<content:encoded><![CDATA[<h2>What does ReactiveUI do?</h2>
<p>
<a href="http://www.reactiveui.net">ReactiveUI</a> is a M-V-VM framework like MVVM Light or Caliburn.Micro, that is deeply integrated with the Reactive Extensions for .NET. This allows you to write code in your ViewModel that is far more elegant and terse when expressing complex stateful interactions, as well as much simpler handling of async operations. Check out this video for an overview:
</p>
<p align="center">
<a href="http://blog.paulbetts.org/index.php/2011/02/14/new-release-reactiveui-2-1/"><em>Click here to view the embedded video.</em></a>
</p>
<h2>ReactiveUI on Hanselminutes</h2>
<p>
Check out <a href="http://hanselminutes.com/default.aspx?showID=271">the recent Hanselminutes episode about the Reactive Extensions</a> as well if you&#8217;ve got more time. Scott and I chat about some of the ideas in RxUI and how we can take the ideas in the Reactive Extensions and use RxUI to apply them to Silverlight and WPF apps.
</p>
<h2>What&#8217;s new in ReactiveUI 2.1 &#8211; bindings galore!</h2>
<ul>
<li>ObservableForProperty now accepts <b>full paths</b>, similar to Xaml bindings &#8211; this makes it much easier to write complex expressions</li>
<li>Combining properties correctly is much easier with a new Object.WhenAny() method that acts like a n-way CombineLatest optimized for binding use</li>
<li>A new method called BindTo allows you to automatically update a read-write property using an Observable; this can be combined with WithAny() to easily create one-way bindings between ViewModel objects</li>
<li>Improved CachedSelectMany that allows you to share a cache between different parts of the code</li>
<li>Utility method ToCommand which invokes an ICommand based on an IObservable</li>
<li>ReactiveUI now uses the latest Rx.NET release, and solves some NuGet issues that were present in the WP7 release</li>
<li>Lots of bug fixes, especially to MessageBus and ReactiveAsyncCommand; a huge thanks to the folks on the <a href="http://groups.google.com/group/reactivexaml">Google Group</a> for helping out with bug reports</li>
</ul>
<h2>Had trouble with NuGet lately? We fixed that.</h2>
<p>
Recently, ReactiveUI has been having some trouble on NuGet, with both the WP7 and Desktop packages. Hopefully all of these problems have been fixed, though you&#8217;ll have to update your existing code to be compatible with the latest Rx.NET &#8211; for me, this mainly affected the Publish() operator, but is <a href="https://github.com/xpaulbettsx/ReactiveUI/commit/c2aff29b662b364b4a0dff4b2e17909ddfb48a56">relatively easy to fix</a>.
</p>
<h2>Where can I find the library?</h2>
<p>
On <a href="http://nuget.org">NuGet</a>! The best way to install ReactiveUI for a project is by installing the <a href="http://nuget.org/Packages/Packages/Details/reactiveui-2-1-0-1">ReactiveUI package</a> for WPF/Silverlight projects, or <a href="http://nuget.org/Packages/Packages/Details/reactiveui-wp7-2-1-0-1">ReactiveUI-WP7</a> for Windows Phone 7 projects.
</p>
<p>
If NuGet isn&#8217;t your thing, you can also find the binaries on the Github page: <a href="https://github.com/downloads/xpaulbettsx/ReactiveUI/ReactiveUI%202.1.0.1.zip">ReactiveUI 2.1.0.1.zip</a>.
</p>
<h2>Where can I see a sample?</h2>
<p>
A sample project for WPF 4.0 that includes everything you need to see how it works is on the Github page: <a href="https://github.com/downloads/xpaulbettsx/ReactiveUI/ReactiveUI%202.1.0.1%20Sample.zip">ReactiveUI 2.1 Sample.zip</a>. It includes a small sample app, the RxUI binaries, and some sample test cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/02/14/new-release-reactiveui-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview with XAMLCast about ReactiveXaml</title>
		<link>http://blog.paulbetts.org/index.php/2010/10/28/interview-with-xamlcast-about-reactivexaml/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/10/28/interview-with-xamlcast-about-reactivexaml/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 21:56:11 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Reactive Extensions]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WPF / Silverlight]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=574</guid>
		<description><![CDATA[Awhile back I did an interview with XAMLCast about the philosophy behind ReactiveXaml and basically what the library is about. If you&#8217;ve got the time between checking out all the great PDC10 videos, check this out as well:]]></description>
			<content:encoded><![CDATA[<p>
Awhile back I did an interview with <a href="http://virtualdreams.com.br/blog/category/xamlcast/">XAMLCast</a> about the philosophy behind ReactiveXaml and basically what the library is about. If you&#8217;ve got the time between checking out all the great <a href="http://player.microsoftpdc.com/session">PDC10 videos</a>, check this out as well:
</p>
<p align="center">
<a href="http://blog.paulbetts.org/index.php/2010/10/28/interview-with-xamlcast-about-reactivexaml/"><em>Click here to view the embedded video.</em></a>
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/10/28/interview-with-xamlcast-about-reactivexaml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ReactiveXaml Series: On combining notifications</title>
		<link>http://blog.paulbetts.org/index.php/2010/08/14/reactivexaml-series-on-combining-notifications/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/08/14/reactivexaml-series-on-combining-notifications/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 00:56:01 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=514</guid>
		<description><![CDATA[I was excited today when I got my first Email post to the Google Group for RxXaml, and even better, it was a great question; what the poster was asking about really strikes to the core of why Rx and ReactiveXaml are compelling in my mind. In my experimentation, I&#8217;ve come across a number of [...]]]></description>
			<content:encoded><![CDATA[<p>
I was excited today when I got my first Email post <a href="http://groups.google.com/group/reactivexaml/">to the Google Group for RxXaml</a>, and even better, it was a <b>great</b> question; what the poster was asking about really strikes to the core of why Rx and ReactiveXaml are compelling in my mind. In my experimentation, I&#8217;ve come across a number of useful patterns that I should&#8217;ve mentioned earlier &#8211; I showed you how to <i>get</i> the notifications, but not how to use them!
</p>
<p>
When I say &#8216;notification&#8217;, you have to read into this term very broadly and kind of stretch your brain a bit: as a reminder, here are some examples of what are notifications in Rx and RxXaml:</p>
<ul>
<li>A simple .NET event (i.e. via Observable.FromEvent)</li>
<li>Whenever a property changes (via ReactiveObject)</li>
<li>When an ICommand is invoked (ReactiveCommand)</li>
<li>Any time any sort of asynchronous operation completes (via Observable.FromAsyncCommand, ReactiveAsyncCommand, or QueuedAsyncMRUCache)</li>
<li>In response to an explicit notification (via a Subject)</li>
</ul>
<h2>Combining notifications in meaningful ways</h2>
<p>
One of the most powerful parts of the Reactive Extensions is its ability to combine single events compositionally &#8211; when I describe what Rx is to people, I often use the description, &#8220;Rx gives you the ability to take simple events and combine them together into something more specific and useful &#8211; I don&#8217;t <i>really</i> care when the &#8216;MouseUp&#8217; and &#8216;KeyDown&#8217; events happen, I want to know when the &#8216;User dropped a file on the top left corner&#8217; happens &#8211; tell me about <i>that</i>.&#8221;
</p>
<p>
To this effect, there are several tricks that we can do. The first one is, that you must remember that ReactiveObject fires its IObservable when <b>any</b> property changes &#8211; this means, that it&#8217;s very easy to watch an entire object. Often, this is useful enough &#8211; when it isn&#8217;t, <code>Where</code>helps you out:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">ReactiveObject Toaster;</p>
<p><span class="co1">// Any change will print something</span><br />
Toaster.<span class="me1">Subscribe</span><span class="br0">&#40;</span>x =&gt; Console.<span class="me1">WriteLine</span><span class="br0">&#40;</span><span class="st0">&quot;{0} changed!&quot;</span>, x.<span class="me1">PropertyName</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// This is an observable that only notifies when the Foo property changes</span><br />
var FooChanged = Toaster.<span class="me1">Where</span><span class="br0">&#40;</span>x =&gt; x.<span class="me1">PropertyName</span> == <span class="st0">&quot;Foo&quot;</span><span class="br0">&#41;</span>;</div>
<h2>Merge, CombineLatest, and Zip &#8211; the &#8216;And&#8217; and &#8216;Or&#8217; of Rx</h2>
<p>
So, to combine several IObservables, we have a few useful methods that stand out. The first is <code>Observable.Merge</code>: as its name implies, Merge takes several IObservables <i>of the same type</i>, and returns an IObservable that fires when <b>any one of its inputs fires</b>. Thinking in a boolean sense, <b>Merge is kind of like <i>Or</i></b>. Having to be of the same type isn&#8217;t as onerous of a requirement:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">IObservable<span class="br0">&#91;</span><span class="kw4">float</span><span class="br0">&#93;</span> O1;<br />
IObservable<span class="br0">&#91;</span><span class="kw4">int</span><span class="br0">&#93;</span> O2;<br />
IObservable<span class="br0">&#91;</span><span class="kw4">string</span><span class="br0">&#93;</span> O3;</p>
<p><span class="co1">// Tell me when *any* of these 3 send a notification</span><br />
var result = Observable.<span class="me1">Merge</span><span class="br0">&#40;</span><br />
&nbsp; &nbsp; O1.<span class="me1">Select</span><span class="br0">&#40;</span>_ =&gt; <span class="kw2">true</span><span class="br0">&#41;</span>, O2.<span class="me1">Select</span><span class="br0">&#40;</span>_ =&gt; <span class="kw2">true</span><span class="br0">&#41;</span>, O3.<span class="me1">Select</span><span class="br0">&#40;</span>_ =&gt; <span class="kw2">true</span><span class="br0">&#41;</span><br />
<span class="br0">&#41;</span>;</div>
<p>
One of the difficulties of Merge that can sometimes bite you, is that it is <b>stateless</b> &#8211; when you get a notification about O1, you don&#8217;t have any knowledge about what items came in on O2 or O3. For two IObservables, we have a handy method called <code>Observable.CombineLatest</code>. This method will &#8220;remember&#8221; the last item that came in on both sides &#8211; when O1 changes, it will give you the new O1 <i>and the latest value of O2</i>. Furthermore, we can take the <b>result</b> and expose it as a change-notifying property <a href="http://blog.paulbetts.org/index.php/2010/07/05/reactivexaml-series-implementing-search-with-observableaspropertyhelper/">via ObservableAsPropertyHelper</a>.
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="co1">// Subjects are just IObservables that we can trigger by-hand</span><br />
<span class="co1">// They&#8217;re the mutable variables of Rx</span><br />
Subject<span class="br0">&#91;</span><span class="kw4">int</span><span class="br0">&#93;</span> s1;<br />
Subject<span class="br0">&#91;</span><span class="kw4">int</span><span class="br0">&#93;</span> s2;</p>
<p><span class="co1">// Combine s1 with s2 and write its output to Console</span><br />
s1.<span class="me1">CombineLatest</span><span class="br0">&#40;</span>s2, <span class="br0">&#40;</span>a,b<span class="br0">&#41;</span> =&gt; a * b<span class="br0">&#41;</span>.<span class="me1">Subscribe</span><span class="br0">&#40;</span>Console.<span class="me1">WriteLine</span><span class="br0">&#41;</span>;</p>
<p>s1.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">5</span><span class="br0">&#41;</span>;&nbsp; <span class="co1">// Nothing happens, no value for s2</span></p>
<p>s2.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span>;&nbsp; <span class="co1">// 10 came in, combine the 10 with whatever s1 was (5)</span><br />
&gt;&gt;&gt; <span class="nu0">50</span></p>
<p>s2.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">20</span><span class="br0">&#41;</span>; <span class="co1">// 20 came in, still use s1&#8242;s latest value</span><br />
&gt;&gt;&gt; <span class="nu0">100</span></p>
<p>s1.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span>; <span class="co1">// s1 is 1, take s2&#8242;s latest value (20)</span><br />
&gt;&gt;&gt; <span class="nu0">40</span></div>
<p>
Finally, we have <code>Observable.Zip</code>. Like the other two, this function also combines observables, but this function like its IEnumerable counterpart, is only concerned about <b>pairs of items</b>. This means, it&#8217;s more like &#8220;And&#8221; than the other two (remember that it&#8217;s extremely unlikely that notifications will come in at the <i>exact same time</i> so an &#8220;Observable.And&#8221; wouldn&#8217;t make much sense). Zip will not yield elements until it has <b>both</b> of its &#8220;slots&#8221; filled for the next item.
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">Subject<span class="br0">&#91;</span><span class="kw4">int</span><span class="br0">&#93;</span> s1;<br />
Subject<span class="br0">&#91;</span><span class="kw4">int</span><span class="br0">&#93;</span> s2;</p>
<p>s1.<span class="me1">Zip</span><span class="br0">&#40;</span>s2, <span class="br0">&#40;</span>a,b<span class="br0">&#41;</span> =&gt; a * b<span class="br0">&#41;</span>.<span class="me1">Subscribe</span><span class="br0">&#40;</span>Console.<span class="me1">WriteLine</span><span class="br0">&#41;</span>;</p>
<p>s1.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span>; <span class="co1">// Nothing, no pair yet</span><br />
s1.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">5</span><span class="br0">&#41;</span>; <span class="co1">// Still no pair</span><br />
s2.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span>; <span class="co1">// We&#8217;ve got a pair (2,10), let&#8217;s send it down</span><br />
&gt;&gt;&gt; <span class="nu0">20</span></p>
<p>s1.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span>; <span class="co1">// s2&#8242;s empty, no pair</span><br />
s2.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>; <span class="co1">// 5 * 1</span><br />
&gt;&gt;&gt; <span class="nu0">5</span><br />
s2.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span>; <span class="co1">// 10*10</span><br />
&gt;&gt;&gt; <span class="nu0">100</span><br />
s2.<span class="me1">OnNext</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span>; <span class="co1">// s1&#8242;s empty, no output</span></div>
<h2>Combining Notifications for Visual State Manager</h2>
<p>
Here&#8217;s another clever trick that I really like &#8211; often, we need to change the visual state on a variety of different notifications of different types and are unrelated. Here&#8217;s how to do it:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">IObservable<span class="br0">&#91;</span><span class="kw4">int</span><span class="br0">&#93;</span> SomethingToWatch, SomethingElse;<br />
IObservable<span class="br0">&#91;</span><span class="kw4">float</span><span class="br0">&#93;</span> AThirdThing;<br />
var state = Observable.<span class="me1">Merge</span><span class="br0">&#40;</span><br />
&nbsp; &nbsp; SomethingToWatch.<span class="me1">Select</span><span class="br0">&#40;</span>_ =&gt; <span class="st0">&quot;State1&quot;</span><span class="br0">&#41;</span>,<br />
&nbsp; &nbsp; SomethingElse.<span class="me1">Select</span><span class="br0">&#40;</span>_ =&gt; <span class="st0">&quot;State2&quot;</span><span class="br0">&#41;</span>,<br />
&nbsp; &nbsp; AThirdThing.<span class="me1">Select</span><span class="br0">&#40;</span>_ =&gt; <span class="st0">&quot;State3&quot;</span><span class="br0">&#41;</span><br />
<span class="br0">&#41;</span>;</p>
<p>state.<span class="me1">Subscribe</span><span class="br0">&#40;</span>x =&gt; <br />
&nbsp; &nbsp; VisualStateManager.<span class="me1">GoToState</span><span class="br0">&#40;</span>this, x, <span class="kw2">true</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
<p>
Observable.Merge can also be used along with Scan to keep a reference count, check out <a href="https://github.com/xpaulbettsx/ReactiveUI/blob/master/ReactiveUI.Xaml/ReactiveAsyncCommand.cs#L83">this example from ReactiveAsyncCommand</a> where we use two observables and Select them to 1 and -1, then keep a running count via Scan.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/08/14/reactivexaml-series-on-combining-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comments are disabled</title>
		<link>http://blog.paulbetts.org/index.php/2010/05/31/comments-are-disabled/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/05/31/comments-are-disabled/#comments</comments>
		<pubDate>Mon, 31 May 2010 21:41:35 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2010/05/31/comments-are-disabled/</guid>
		<description><![CDATA[I&#8217;m sick of dealing with comment spam.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sick of dealing with comment spam.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/05/31/comments-are-disabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oops, I have a blog</title>
		<link>http://blog.paulbetts.org/index.php/2010/04/27/oops-i-have-a-blog/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/04/27/oops-i-have-a-blog/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 02:43:56 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2010/04/27/oops-i-have-a-blog/</guid>
		<description><![CDATA[I&#8217;ll post something soon, I promise. In the meantime, follow @xpaulbettsx on Twitter]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll post something soon, I promise. In the meantime, follow <a href="http://twitter.com/xpaulbettsx">@xpaulbettsx</a> on Twitter </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/04/27/oops-i-have-a-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This is how I should be creating</title>
		<link>http://blog.paulbetts.org/index.php/2010/02/26/this-is-how-i-should-be-creating/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/02/26/this-is-how-i-should-be-creating/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 22:41:21 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=411</guid>
		<description><![CDATA[VONNEGUT I said in Slapstick that she was the person I wrote for—that every successful creative person creates with an audience of one in mind. That&#8217;s the secret of artistic unity. Anybody can achieve it, if he or she will make something with only one person in mind. I didn&#8217;t realize that she was the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
VONNEGUT</p>
<p>I said in Slapstick that she was the person I wrote for—that every successful creative person creates with an audience of one in mind. That&#8217;s the secret of artistic unity. Anybody can achieve it, if he or she will make something with only one person in mind. I didn&#8217;t realize that she was the person I wrote for until after she died.
</p></blockquote>
<p>Via <a href="http://theparisreview.org/viewinterview.php/prmMID/3605">The Paris Review</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/02/26/this-is-how-i-should-be-creating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My original contribution to the Failboat meme</title>
		<link>http://blog.paulbetts.org/index.php/2007/09/12/my-original-contribution-to-the-failboat-meme/</link>
		<comments>http://blog.paulbetts.org/index.php/2007/09/12/my-original-contribution-to-the-failboat-meme/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 17:17:35 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/09/12/my-original-contribution-to-the-failboat-meme/</guid>
		<description><![CDATA[Also, this is a test of the new Windows Live Writer beta. But mostly it&#8217;s about the Failboat.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.paulbetts.org/wp-content/uploads/2007/09/dasfailboot.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="194" alt="DasFailboot" src="http://blog.paulbetts.org/wp-content/uploads/2007/09/dasfailboot-thumb.jpg" width="244" border="0" /></a> </p>
<p>Also, this is a test of the new Windows Live Writer beta. But mostly it&#8217;s about the Failboat.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2007/09/12/my-original-contribution-to-the-failboat-meme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Psst a riddle</title>
		<link>http://blog.paulbetts.org/index.php/2007/04/30/psst-a-riddle/</link>
		<comments>http://blog.paulbetts.org/index.php/2007/04/30/psst-a-riddle/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 17:41:36 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/index.php/2007/04/30/psst-a-riddle/</guid>
		<description><![CDATA[This might help you to process movies that are defined higher than the garden-variety ones, but only if you think in hexadecimainfully: nine 249 17 two 157 116 227 91 216 sixty and five 86 197 (40+59) 86 136 192]]></description>
			<content:encoded><![CDATA[<p>This might help you to process movies that are defined higher than the garden-variety ones, but only if you think in hexadecimainfully:</p>
<p><span id="more-161"></span></p>
<p>nine<br />
249<br />
17<br />
two<br />
157<br />
116<br />
227<br />
91<br />
216<br />
sixty and five<br />
86<br />
197<br />
(40+59)<br />
86<br />
136<br />
192</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2007/04/30/psst-a-riddle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

