<?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; Mono / .NET</title>
	<atom:link href="http://blog.paulbetts.org/index.php/category/programming/mono-net/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 Released</title>
		<link>http://blog.paulbetts.org/index.php/2011/09/01/sassandcoffee-1-1-released/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/09/01/sassandcoffee-1-1-released/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 04:32:39 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=774</guid>
		<description><![CDATA[What does SassAndCoffee do? SassAndCoffee is a library for ASP.NET (both MVC and old-school WebForms) that adds drop-in support for two new languages: Sass and SCSS, a language that allows you to write reusable, more structured CSS, as well as CoffeeScript, which is a JavaScript dialect that is much more syntactically elegant, but still preserving [...]]]></description>
			<content:encoded><![CDATA[<h2>What does SassAndCoffee do?</h2>
<p>
<a href="http://github.com/xpaulbettsx/sassandcoffee">SassAndCoffee is a library for ASP.NET</a> (both MVC and old-school WebForms) that adds drop-in support for two new languages: <a href="http://www.sass-lang.com/tutorial.html">Sass and SCSS</a>, a language that allows you to write reusable, more structured CSS, as well as <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>, which is a JavaScript dialect that is much more syntactically elegant, but still preserving 100% compatibility with regular JavaScript.
</p>
<h2>How to use SassAndCoffee</h2>
<ul>
<li>Add the package reference <a href="http://nuget.org/List/Packages/SassAndCoffee">via NuGet</a></li>
<li>Add a .coffee, .scss, or .sass file to your project (an easy test is to just rename a CSS file to .scss)</li>
<li>Reference the file as if it was a CSS or .JS file (i.e. to reference &#8220;scripts/test.coffee&#8221;, you should reference &#8220;scripts/test.js&#8221; in your SCRIPT tag)</li>
<li>To get the minified version of a file (either a coffee file or a standard js file), ask for the &#8220;.min.js&#8221; version (i.e. &#8220;scripts/test.min.js&#8221;)</li>
</ul>
<h2>What&#8217;s New in SassAndCoffee 1.1 &#8211; Update All The Things</h2>
<p>
SassAndCoffee updates its version of V8 to the latest released code that runs even faster, as well as the latest released version of CoffeeScript, version 1.1.2. In an attempt to catch some tricky-to-debug errors that folks are having on 64-Bit IIS, I&#8217;ve also disabled Jurassic on 64-bit AppPools, since it was unusably slow anyways. This means that if V8 fails, SassAndCoffee will crash and hopefully provide some debugging information to assist in telling me what&#8217;s going on.
</p>
<h2>What else is new?</h2>
<p>
SassAndCoffee now correctly handles JavaScript with non-ASCII characters, as long as the file is encoded in UTF-8. Thanks to <a href="https://github.com/radiy">Roman Kvasov</a> who taught me a thing or two about V8 that I didn&#8217;t know, as well as contributing the code to fix it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/09/01/sassandcoffee-1-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SassAndCoffee hits 1.0!</title>
		<link>http://blog.paulbetts.org/index.php/2011/07/12/sassandcoffee-hits-1-0/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/07/12/sassandcoffee-hits-1-0/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 03:23:53 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=769</guid>
		<description><![CDATA[What does SassAndCoffee do? SassAndCoffee is a library for ASP.NET (both MVC and old-school WebForms) that adds drop-in support for two new languages: Sass and SCSS, a language that allows you to write reusable, more structured CSS, as well as CoffeeScript, which is a JavaScript dialect that is much more syntactically elegant, but still preserving [...]]]></description>
			<content:encoded><![CDATA[<h2>What does SassAndCoffee do?</h2>
<p>
<a href="http://github.com/xpaulbettsx/sassandcoffee">SassAndCoffee is a library for ASP.NET</a> (both MVC and old-school WebForms) that adds drop-in support for two new languages: <a href="http://www.sass-lang.com/tutorial.html">Sass and SCSS</a>, a language that allows you to write reusable, more structured CSS, as well as <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>, which is a JavaScript dialect that is much more syntactically elegant, but still preserving 100% compatibility with regular JavaScript.
</p>
<h2>How to use SassAndCoffee</h2>
<ul>
<li>Add the package reference <a href="http://nuget.org/List/Packages/SassAndCoffee">via NuGet</a></li>
<li>Add a .coffee, .scss, or .sass file to your project (an easy test is to just rename a CSS file to .scss)</li>
<li>Reference the file as if it was a CSS or .JS file (i.e. to reference &#8220;scripts/test.coffee&#8221;, you should reference &#8220;scripts/test.js&#8221; in your SCRIPT tag)</li>
<li>To get the minified version of a file (either a coffee file or a standard js file), ask for the &#8220;.min.js&#8221; version (i.e. &#8220;scripts/test.min.js&#8221;)</li>
</ul>
<h2>What&#8217;s New in SassAndCoffee 1.0 &#8211; Rigging VS2010 to be compatible</h2>
<p>
The most common issue that people experience with using SassAndCoffee wasn&#8217;t actually an issue with the code at all &#8211; the symptoms were that it would work fine on their development machine, but when they deployed to production, all the SCSS/CoffeeScript files would return 404 File Not Found.
</p>
<p>
Why? Since VS2010 doesn&#8217;t recognize these files, <b>it sets its build action to &#8216;None&#8217;</b>, which means the files won&#8217;t be deployed. However, since VS runs your app locally from the same directory, it would still find the files on your box. The ultimate case of &#8220;Works On My Machine&#8221;!
</p>
<p align="center">
<img src="http://blog.paulbetts.org/wp-photos/scssproperties.png" /><br />
<i>The Properties Dialog, where you can reset this property</i>
</p>
<h2>Well that&#8217;s annoying. How do you fix it?</h2>
<p>
Now, when you install SassAndCoffee, you will see a dialog offering to install a file onto your box &#8211; this &#8220;pkgdef&#8221; file will configure VS to consider Sass/SCSS/Coffee files as Content. <a href="http://blog.andreloker.de/post/2010/07/02/Visual-Studio-default-build-action-for-non-default-file-types.aspx">Here&#8217;s the details on how this works</a>.
</p>
<h2>Configurable Caching Support</h2>
<p>
SassAndCoffee now has three types of cache options, which can be configured by adding a setting to the <code>appSettings</code> block with a key of <code>SassAndCoffee.Cache</code>:
</p>
<ul>
<li><b>NoCache</b> &#8211; Compile every file when requested, don&#8217;t cache anything</li>
<li><b>InMemoryCache</b> &#8211; Cache a limited number of files in-memory, but don&#8217;t persist anything to disk</li>
<li><b>FileCache</b> &#8211; The default option (and previous behavior) &#8211; cache compiled files in App_Data</li>
</ul>
<h2>What else is new?</h2>
<ul>
<li>SassAndCoffee had its <b>first external contributions</b> by Steven Robbins and Ken Browning! You have no idea how excited I am about this.</li>
<li>The biggest change was <b>support for <a href="https://github.com/NancyFx/Nancy">NancyFx</a></b> by Steven&#8217;s Herculean effort to decouple the core compilation code from the ASP.NET pipeline. SassAndCoffee is now in a great place for other non-ASP.NET frameworks to use as well, such as Manos.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/07/12/sassandcoffee-hits-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Threading bugs in ReactiveUI in Silverlight</title>
		<link>http://blog.paulbetts.org/index.php/2011/06/23/threading-bugs-in-reactiveui-in-silverlight/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/06/23/threading-bugs-in-reactiveui-in-silverlight/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 20:41:51 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reactive Extensions]]></category>
		<category><![CDATA[WPF / Silverlight]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=760</guid>
		<description><![CDATA[The symptoms of this bug If you use the Silverlight version of ReactiveUI, you will currently encounter a lot of issues that appear to be the classic InvalidOperationException, where a Silverlight object is being accessed by a background thread &#8211; it might look something like this: at System.Windows.Threading.Dispatcher.VerifyAccess() at System.Windows.DependencyObject.GetValue(DependencyProperty dp) at System.Windows.Controls.Primitives.ButtonBase.get_Command() at System.Windows.Controls.Primitives.ButtonBase.UpdateCanExecute() [...]]]></description>
			<content:encoded><![CDATA[<h2>The symptoms of this bug</h2>
<p>
If you use the Silverlight version of ReactiveUI, you will currently encounter a lot of issues that appear to be the classic InvalidOperationException, where a Silverlight object is being accessed by a background thread &#8211; it might look something like this:
</p>
<p><code><br />
 at System.Windows.Threading.Dispatcher.VerifyAccess()<br />
  at System.Windows.DependencyObject.GetValue(DependencyProperty dp)<br />
  at System.Windows.Controls.Primitives.ButtonBase.get_Command()<br />
  at System.Windows.Controls.Primitives.ButtonBase.UpdateCanExecute()<br />
  at<br />
System.Windows.Controls.Primitives.ButtonBase.OnCanExecuteChanged(Object<br />
sender, EventArgs e)<br />
  at ReactiveUI.Xaml.ReactiveCommand.<commonctor>b__0(Boolean b)<br />
  at<br />
ReactiveUI.ObservableAsPropertyHelper`1.<>c__DisplayClass4.< .ctor>b__0(T<br />
x)<br />
  at System.Reactive.AnonymousObserver`1.Next(T value)<br />
  at System.Reactive.AbstractObserver`1.OnNext(T value)<br />
  at System.Reactive.AnonymousObservable`1.AutoDetachObserver.Next(T<br />
value)<br />
  at System.Reactive.AbstractObserver`1.OnNext(T value)<br />
  at<br />
System.Reactive.ScheduledObserver`1.<>c__DisplayClass639.<next>b__637()<br />
  at System.Reactive.ScheduledObserver`1.<ensureactive>b__634(Action<br />
self)<br />
</ensureactive></next></commonctor></code></p>
<p>
You&#8217;ll also see the message in the Console output, <code>"WPF Rx.NET DLL reference not added - using Event Loop"</code>
</p>
<h2>How to fix it</h2>
<p>
The easiest way to fix this is by adding this block to your App.xaml.cs:
</p>
<style type="text/css"></style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">protected override void OnStartup(StartupEventArgs e)<br />
{<br />
&nbsp; &nbsp; RxApp.DeferredScheduler = DispatcherScheduler.Instance;<br />
&nbsp; &nbsp; base.OnStartup(e);<br />
}</div>
<h2>What&#8217;s the Deal??</h2>
<p>
One of the goals of RxUI was that the core library didn&#8217;t have a dependency on WPF/Silverlight: since an Observable Model object or an Observable collection is useful regardless of the domain!  However, to do this, we need to do some trickery to ensure the experience is correct.
</p>
<p>
In a Console app, we don&#8217;t have a message loop, so we use EventLoopScheduler; this has the result of creating a single thread where all of our &#8220;UI actions&#8221; happen &#8211; it&#8217;s a Dispatcher without the Dispatcher. In WPF/Silverlight, we <i>do</i> have a real message loop, so we want to use DispatcherScheduler as our &#8220;put it on the UI thread&#8221; scheduler &#8211; <i>but</i>, we can&#8217;t link to System.Reactive.Threading.dll without pulling in WPF, even if we don&#8217;t use it!
</p>
<p>
What I do is, in the RxApp startup routine, <a href="https://github.com/xpaulbettsx/ReactiveUI/blob/b9a2678e35f01b110d67538e1b98373ec5233c29/ReactiveUI/RxApp.cs#L264">I use Reflection to attempt to find the DispatcherScheduler</a> Type and instantiate it at runtime. In WPF, the code that is currently there works like gangbusters &#8211; in Silverlight though, you have to be <i>way more specific</i> &#8211; <a href="http://groups.google.com/group/reactivexaml/browse_thread/thread/62ff8b21f625ab44">Lukas Cenovsky does a great job tracking down the bug in this mail thread</a>: you have to specify not just the fully namespaced Type name, but the fully qualified assembly name! (i.e. not just &#8220;System.Reactive.Windows.Threading&#8221;, but all of the version details and the public key token.
</p>
<h2>How come this doesn&#8217;t happen in unit tests?</h2>
<p>
Because in Unit Tests, there <i>is no working Dispatcher</i> (you can queue items to it, but they will never run) &#8211; ReactiveUI knows this and <a href="https://github.com/xpaulbettsx/ReactiveUI/blob/b9a2678e35f01b110d67538e1b98373ec5233c29/ReactiveUI/RxApp.cs#L50">switches the Scheduler automatically in a unit test runner</a> to Immediate, which makes writing simple unit tests far easier. That has the side-effect for <i>me</i> though, that some of my code is never covered by a unit test. Oops!
</p>
<p>
<b>tl;dr; -</b> Reflection works a lot differently on Silverlight, and is generally way more of a pain.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/06/23/threading-bugs-in-reactiveui-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Release: SassAndCoffee 0.9 &#8211; now not glacially slow!</title>
		<link>http://blog.paulbetts.org/index.php/2011/06/06/new-release-sassandcoffee-0-9-now-not-glacially-slow/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/06/06/new-release-sassandcoffee-0-9-now-not-glacially-slow/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 08:02:06 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=758</guid>
		<description><![CDATA[What does SassAndCoffee do? SassAndCoffee is a library for ASP.NET (both MVC and old-school WebForms) that adds drop-in support for two new languages: Sass and SCSS, a language that allows you to write reusable, more structured CSS, as well as CoffeeScript, which is a JavaScript dialect that is much more syntactically elegant, but still preserving [...]]]></description>
			<content:encoded><![CDATA[<h2>What does SassAndCoffee do?</h2>
<p>
<a href="http://github.com/xpaulbettsx/sassandcoffee">SassAndCoffee is a library for ASP.NET</a> (both MVC and old-school WebForms) that adds drop-in support for two new languages: <a href="http://www.sass-lang.com/tutorial.html">Sass and SCSS</a>, a language that allows you to write reusable, more structured CSS, as well as <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>, which is a JavaScript dialect that is much more syntactically elegant, but still preserving 100% compatibility with regular JavaScript.
</p>
<h2>How to use SassAndCoffee</h2>
<ul>
<li>Add the package reference <a href="http://nuget.org/List/Packages/SassAndCoffee">via NuGet</a></li>
<li>Add a .coffee, .scss, or .sass file to your project (an easy test is to just rename a CSS file to .scss)</li>
<li>Reference the file as if it was a CSS or .JS file (i.e. to reference &#8220;scripts/test.coffee&#8221;, you should reference &#8220;scripts/test.js&#8221; in your SCRIPT tag)</li>
<li>To get the minified version of a file (either a coffee file or a standard js file), ask for the &#8220;.min.js&#8221; version (i.e. &#8220;scripts/test.min.js&#8221;)</li>
</ul>
<h2>What&#8217;s New in SassAndCoffee 0.9 &#8211; Speed, Speed, Speed!</h2>
<p>
SassAndCoffee now embeds the <a href="http://code.google.com/apis/v8/intro.html">V8 Javascript Engine</a> &#8211; this improves compilation speeds <b>dramatically</b> compared with previous releases. This feature only works on x86/amd64 on Windows, but if you&#8217;re on Mono or some other platform, SassAndCoffee will fall back to the old Jurassic-based engine. All of this is behind the scenes though, nothing changes from the perspective of a user (except for the NuGet package went from 400kb to 3.7MB!)  Compilation speeds for Sass are improved as well through better reuse of IronRuby engine instances.
</p>
<h2>What else is new?</h2>
<ul>
<li>The <a href="http://sass-lang.com/tutorial.html">Sass @import directive</a> now works &#8211; this is an awesome feature of Sass that really allows you to clean up your CSS files and write them more like code and keep it DRY!</li>
<li>Reliability improvements &#8211; less crashification and race conditions</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/06/06/new-release-sassandcoffee-0-9-now-not-glacially-slow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Release: SassAndCoffee 0.8</title>
		<link>http://blog.paulbetts.org/index.php/2011/05/30/new-release-sassandcoffee-0-8/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/05/30/new-release-sassandcoffee-0-8/#comments</comments>
		<pubDate>Tue, 31 May 2011 03:20:27 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=749</guid>
		<description><![CDATA[What does SassAndCoffee do? SassAndCoffee is a library for ASP.NET (both MVC and old-school WebForms) that adds drop-in support for two new languages: Sass and SCSS, a language that allows you to write reusable, more structured CSS, as well as CoffeeScript, which is a JavaScript dialect that is much more syntactically elegant, but still preserving [...]]]></description>
			<content:encoded><![CDATA[<h2>What does SassAndCoffee do?</h2>
<p>
SassAndCoffee is a library for ASP.NET (both MVC and old-school WebForms) that adds drop-in support for two new languages: <a href="http://www.sass-lang.com/tutorial.html">Sass and SCSS</a>, a language that allows you to write reusable, more structured CSS, as well as <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>, which is a JavaScript dialect that is much more syntactically elegant, but still preserving 100% compatibility with regular JavaScript.
</p>
<h2>How to use SassAndCoffee</h2>
<ul>
<li>Add the package reference <a href="http://nuget.org/List/Packages/SassAndCoffee">via NuGet</a></li>
<li>Add a .coffee, .scss, or .sass file to your project (an easy test is to just rename a CSS file to .scss)</li>
<li>Reference the file as if it was a CSS or .JS file (i.e. to reference &#8220;scripts/test.coffee&#8221;, you should reference &#8220;scripts/test.js&#8221; in your SCRIPT tag)</li>
<li>To get the minified version of a file (either a coffee file or a standard js file), ask for the &#8220;.min.js&#8221; version (i.e. &#8220;scripts/test.min.js&#8221;)</li>
</ul>
<h2>Some things you <b>don&#8217;t</b> have to do</h2>
<ul>
<li>Install any extra software, such as Ruby &#8211; everything is embedded in resources.</li>
<li>Do any special configuration or make manual changes to your config files &#8211; NuGet will handle that.</li>
<li>Run any commands to update the files &#8211; SassAndCoffee builds the files on the first request; if you make CSS / JavaScript changes, it&#8217;ll rebuild automatically.</li>
<li>Do any special setup whatsoever when deploying &#8211; if it works on your box, it&#8217;ll work on the remote box (*)</li>
</ul>
<p>
<i>* &#8211; a special note: VS2010 likes to mark CoffeeScript files as &#8216;do not deploy&#8217; &#8211; make sure to hit F4 and mark them as <b>content</b></i>
</p>
<h2>What&#8217;s New in SassAndCoffee 0.8 &#8211; Minification and Combination</h2>
<p>
SassAndCoffee now supports JavaScript minification thanks to <a href="http://marijnhaverbeke.nl/uglifyjs">Mihai Bazon&#8217;s UglifyJS project</a> &#8211; for <i>both</i> CoffeeScript files as well as your existing JavaScript files. It&#8217;s quite simple to use &#8211; anywhere you reference a JS file in your Views, rewrite the reference to &#8220;<b>.min</b>.js&#8221;.
</p>
<p>
It&#8217;s also a good idea to combine several Javascript files into one file to minimize requests &#8211; however trying to do this by-hand is a maintenance nightmare. To this end, SassAndCoffee will do this work for you. Here&#8217;s how to do it:
</p>
<ol>
<li>Open your View file, you probably have references to a bunch of scripts, whose source looks something like: <code>@Url.Content("~/Scripts/jquery-1.5.1.min.js")</code></li>
<li>Copy the actual references (i.e. starting from &#8216;~&#8217; on) to a file whose extension is &#8220;.combine&#8221; (i.e. &#8216;debug_all.combine&#8217;). These files don&#8217;t necessarily have to exist on-disk (i.e. they can be a CoffeeScript file). You can also just write a list of filenames, relative to the .combine file.</li>
<li>Reference the file as if it was a JavaScript file (i.e. &#8216;debug_all.js&#8217;)</li>
<li>If you change either the combine file <i>or any file that it references</i>, it will rebuilt &#8211; no need to rebuild anything by hand!</li>
</ol>
<p>
You can see an example of how this is used <a href="https://github.com/xpaulbettsx/SassAndCoffee/tree/master/WebTest/Scripts">in the WebTest project on GitHub</a>.
</p>
<h2>What else is new?</h2>
<ul>
<li>Scripts are compiled/minified in parallel, improving performance. Unfortunately, minifying a significant number of scripts still takes a <i>long</i> time &#8211; this will be dramatically improved in the next release.</li>
<li>Several bugs were fixed, such as fixing projects that didn&#8217;t have an App_Data folder, as well as a race condition where zero-length files could possibly be served up.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/05/30/new-release-sassandcoffee-0-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Release: ReactiveUI 2.3.1</title>
		<link>http://blog.paulbetts.org/index.php/2011/05/29/new-release-reactiveui-2-3-1/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/05/29/new-release-reactiveui-2-3-1/#comments</comments>
		<pubDate>Sun, 29 May 2011 21:27:16 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reactive Extensions]]></category>
		<category><![CDATA[WPF / Silverlight]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=744</guid>
		<description><![CDATA[What&#8217;s New ReactiveUI 2.3.1 is a maintenance release. The big difference is to fix the NuGet packages because they were targeted at the wrong branch of Rx.NET &#8211; I had built against the 1.0 branch, but only the 1.1 branch is published. Wrong Branch? With the latest release of the Reactive Extensions, the team has [...]]]></description>
			<content:encoded><![CDATA[<h2>What&#8217;s New</h2>
<p>
ReactiveUI 2.3.1 is a maintenance release. The big difference is to fix the <a href="http://nuget.org/List/Packages/reactiveui">NuGet packages</a> because they were targeted at the wrong branch of Rx.NET &#8211; I had built against the 1.0 branch, but only the 1.1 branch is published.
</p>
<h2>Wrong Branch?</h2>
<p>
With the latest release of the Reactive Extensions, the team has split the product into two branches &#8211; the <i>stable</i> release (having a version number of 1.<b>0</b>.10425), and the <i>experimental</i> release (which begins with 1.<b>1</b>). While the term &#8220;Experimental&#8221; sounds scary, it&#8217;s currently a bit of a misnomer &#8211; Experimental is just the Stable release with some extra methods added. Conveniently, they tagged all of the differences with an Attribute called &#8220;Experimental&#8221;, so you can use a disassembler such as ILSpy or JetBrains&#8217; dotPeek to find all of the new cool stuff if you find the &#8220;ExperimentalAttribute&#8221; class, then &#8220;Find Usages&#8221;.
</p>
<p>
Keep in mind, that the reason that the release is Experimental, is that these new APIs are <i>subject to change</i> &#8211; they might work differently in future releases, or be gone altogether.
</p>
<h2>One more thing</h2>
<p>
It&#8217;s not all boring changes &#8211; I added one small feature that folks were asking for: in your class definitions, if you have a custom property getter/setter and can&#8217;t use RaiseAndSetIfChanged, you can now use the Expression syntax with RaisePropertyChanging/RaisePropertyChanged. So, &#8220;RaisePropertyChanged(x => x.SomeProperty)&#8221;.
</p>
<h2>What is Rx-Xaml?</h2>
<p>
For the current Rx release, the DLL that contains &#8220;ObserveOnDispatcher&#8221; (and everything Dispatcher-related) is in a separate &#8220;System.Windows.Reactive.Threading.dll&#8221; assembly. This DLL is needed for any project that uses WPF/Silverlight/WP7. The Rx team decided to publish two <i>separate</i> packages for this DLL, &#8220;Rx-WPF&#8221; and &#8220;Rx-Silverlight&#8221;. While this is easier to grok, it also makes it difficult for projects like ReactiveUI that support both WPF and Silverlight, since I can&#8217;t write the dependency in my NuSpec file correctly. So, I created a new package, &#8220;Rx-Xaml&#8221;, that is a simple merge of &#8220;Rx-WPF&#8221; and &#8220;Rx-Silverlight&#8221; &#8211; based on the platform, it will do the right thing. I&#8217;ll keep this package up-to-date, so feel free to depend on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/05/29/new-release-reactiveui-2-3-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing: SassAndCoffee 0.5</title>
		<link>http://blog.paulbetts.org/index.php/2011/05/16/announcing-sassandcoffee-0-5/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/05/16/announcing-sassandcoffee-0-5/#comments</comments>
		<pubDate>Mon, 16 May 2011 07:33:53 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=735</guid>
		<description><![CDATA[Sass and Who What Now? One of the new controversial features that is being added to the latest version of Rails, is the default inclusion of two languages that make web development easier &#8211; one for simplifying CSS called &#8220;Sass&#8221;, and a language for writing more readable, elegant Javascript, which is called CoffeeScript. The examples [...]]]></description>
			<content:encoded><![CDATA[<h2>Sass and Who What Now?</h2>
<p>
One of the new controversial features that is being added to the latest version of Rails, is the default inclusion of two languages that make web development easier &#8211; one for simplifying CSS <a href="http://sass-lang.com/">called &#8220;Sass&#8221;</a>, and a language for writing more readable, elegant Javascript, which is <a href="http://jashkenas.github.com/coffee-script/">called CoffeeScript</a>. The examples from these two sites illustrate the languages far better than I could. </p>
<p>
Both of these languages share some common characteristics &#8211; they both try to generally stay &#8220;true&#8221; to their target language (i.e. CoffeeScript compiles down to clean, readable JavaScript that generally has a 1:1 mapping from source to target statement), and they both attempt to solve some of the historical &#8220;ugliness&#8221; associated with their target language. I&#8217;ve used both Sass and CoffeeScript before in the past and I think they are a brilliant contribution to web development, and allow you to write cleaner, more reusable code.
</p>
<p>
These two languages have excellent support in Rails, as well as in node.js, two of the latest &#8220;hip&#8221; web development platforms, and I was surprised that someone hadn&#8217;t beaten me to the punch and created NuGet packages to enable support for these &#8211; a lot of people had solutions for different pieces, but most were proof-of-concepts or were difficult to use. With NuGet, there is <b>zero</b> reason that web libraries should be anything other than &#8220;one-click install&#8221;.
</p>
<p>
 So without further ado, I present, <a href="https://github.com/xpaulbettsx/SassAndCoffee">SassAndCoffee &#8211; an ASP.NET library to add drop-in support for Sass/SCSS and CoffeeScript!</a>
</p>
<h2>How to use SassAndCoffee</h2>
<ul>
<li>Add the package reference <a href="http://nuget.org/List/Packages/SassAndCoffee">via NuGet</a></li>
<li>Add a .coffee, .scss, or .sass file to your project (an easy test is to just rename a CSS file to .scss)</li>
<li>Reference the file as if it was a CSS or .JS file (i.e. to reference &#8220;scripts/test.coffee&#8221;, you should reference &#8220;scripts/test.js&#8221; in your SCRIPT tag)</li>
</ul>
<p>That&#8217;s all there is to it! Files will be cached in your AppData folder and will be regenerated whenever you modify them.</p>
<h2>How does it work?</h2>
<p>SassAndCoffee embeds the original compilers in the DLL as (Sass 3.2.0 and CoffeeScript 1.1.0 as of this writing) and uses IronRuby and Jurassic respectively to execute the compilers against your source.</p>
<h2>Why is this better than [SOMEOTHERPROJECT]</h2>
<ul>
<li>No external processes are executed</li>
<li>You don&#8217;t have to install Ruby or node.js</li>
<li>It&#8217;s in NuGet so you don&#8217;t have to fiddle with web.config</li>
<li>Files are cached and are rebuilt as-needed.</li>
</ul>
<h2>Thanks</h2>
<p>Several folks helped me out with some of the integration details of this project &#8211; if it weren&#8217;t for them, I would still be stuck in the mud right now:</p>
<ul>
<li>David Padbury for helping me out with the CoffeeScript compiler</li>
<li>Levi Broderick for giving me a few hints as to how to rig up the HttpModule</li>
<li>Jimmy Schementi for telling me the proper way to redirect &#8216;requires&#8217; to an embedded resource</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/05/16/announcing-sassandcoffee-0-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Release: ReactiveUI 2.3</title>
		<link>http://blog.paulbetts.org/index.php/2011/05/08/new-release-reactiveui-2-3/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/05/08/new-release-reactiveui-2-3/#comments</comments>
		<pubDate>Sun, 08 May 2011 18:36:41 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reactive Extensions]]></category>
		<category><![CDATA[WPF / Silverlight]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=728</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/05/08/new-release-reactiveui-2-3/"><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.3 &#8211; update to work with Rx 1.1.10425</h2>
<p>
As you may have noticed, the latest version of Rx has changed quite a bit, in both the functionality and the namespace structure. The latest build is just a release to make RxUI compatible. Another fix is, that since NuGet 1.2+ fixes the support for WP7, so I&#8217;ve updated the normal packages. If you&#8217;re already using the WP7-specific packages, I&#8217;ve updated those too.
</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-3-0-1">ReactiveUI package</a> for WPF/Silverlight/new WP7 projects, or <a href="http://nuget.org/Packages/Packages/Details/reactiveui-wp7-2-3-0-1">ReactiveUI-WP7</a> for existing 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.3.0.0.zip">ReactiveUI 2.3.0.0.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/05/08/new-release-reactiveui-2-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PSA: Parallels Shared Folders breaks IIS Express</title>
		<link>http://blog.paulbetts.org/index.php/2011/05/02/psa-parallels-shared-folders-breaks-iis-express/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/05/02/psa-parallels-shared-folders-breaks-iis-express/#comments</comments>
		<pubDate>Mon, 02 May 2011 20:12:04 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=724</guid>
		<description><![CDATA[If you&#8217;re using Parallels Desktop and you&#8217;re trying to use the awesome new MVC stack (IIS Express, SQL Compact, Razor views), you&#8217;ll find something quite frustrating: you&#8217;ll get error messages to the effect of &#8220;redirection.config: File cannot be found&#8221;. Disable Parallels Shared Folders The cause is that files that are normally local are being redirected [...]]]></description>
			<content:encoded><![CDATA[<p>
If you&#8217;re using Parallels Desktop and you&#8217;re trying to use the awesome new MVC stack (IIS Express, SQL Compact, Razor views), you&#8217;ll find something quite frustrating: you&#8217;ll get error messages to the effect of <i>&#8220;redirection.config: File cannot be found&#8221;</i>.
</p>
<h2>Disable Parallels Shared Folders</h2>
<p>
The cause is that files that are normally local are being redirected to network shares. Disable this in Parallels and all will be right with the world again!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/05/02/psa-parallels-shared-folders-breaks-iis-express/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ReactiveUI with MVVM Light (or any other framework!)</title>
		<link>http://blog.paulbetts.org/index.php/2011/04/04/using-reactiveui-with-mvvm-light-or-any-other-framework/</link>
		<comments>http://blog.paulbetts.org/index.php/2011/04/04/using-reactiveui-with-mvvm-light-or-any-other-framework/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 22:54:19 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reactive Extensions]]></category>
		<category><![CDATA[WPF / Silverlight]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=714</guid>
		<description><![CDATA[ReactiveUI: Is it All or None? No! RxUI provides all of the core components that you need to use the M-V-VM pattern, but many people already have applications written using some of the other great .NET MVVM frameworks, such as MVVM Light or Caliburn.Micro &#8211; rewriting an entire codebase just to use Rx is a [...]]]></description>
			<content:encoded><![CDATA[<h2>ReactiveUI: Is it All or None?</h2>
<p>
No! RxUI provides all of the core components that you need to use the M-V-VM pattern, but many people already have applications written using some of the other great .NET MVVM frameworks, such as MVVM Light or Caliburn.Micro &#8211; rewriting an entire codebase just to use Rx is a total bummer.
</p>
<p>
Fortunately, in ReactiveUI 2.2, there have been several features introduced in order to make using RxUI with existing frameworks easier &#8211; you can try out RxUI on a per-page basis, instead of rewriting your whole app.
</p>
<p>
There are really three core bits that are central to MVVM: a ViewModel object, an ICommand implementation, and a change-notifying Collection. Let&#8217;s take a look at how we can Rx&#8217;ify these three items.
</p>
<h2>Using MVVM Light alongside ReactiveUI</h2>
<p>
First, <b>File-&gt;New Project</b> and create a new &#8220;MVVM Light&#8221; projects via the template. Then via NuGet (you are using NuGet, right?), add a reference to the &#8220;ReactiveUI&#8221; project. Now, crack open MainViewModel.cs. The <strong>critical</strong> thing to know is, <i>all of RxUI&#8217;s awesomeness are extensions onto an interface called IReactiveNotifyPropertyChanged</i>. Ergo, we need to make MainViewModel implement this. But don&#8217;t panic, it&#8217;s easy!
</p>
<p>
<b>Step 1:</b> Change the class definition to implement IReactiveNotifyPropertyChanged.
</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: #0600FF;}.ch_code_container .kw2 {color: #FF8000; font-weight: bold;}.ch_code_container .kw3 {color: #008000;}.ch_code_container .kw4 {color: #FF0000;}.ch_code_container .kw5 {color: #000000;}.ch_code_container .co1 {color: #008080; font-style: italic;}.ch_code_container .co2 {color: #008080;}.ch_code_container .coMULTI {color: #008080; font-style: italic;}.ch_code_container .es0 {color: #008080; font-weight: bold;}.ch_code_container .br0 {color: #008000;}.ch_code_container .st0 {color: #808080;}.ch_code_container .nu0 {color: #FF0000;}.ch_code_container .me1 {color: #0000FF;}.ch_code_container .me2 {color: #0000FF;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw1">public</span> <span class="kw4">class</span> MainViewModel : ViewModelBase, IReactiveNotifyPropertyChanged</div>
<p>
<b>Step 2:</b> Add a field of type &#8220;MakeObjectReactiveHelper&#8221;, and initialize it in the constructor:
</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: #0600FF;}.ch_code_container .kw2 {color: #FF8000; font-weight: bold;}.ch_code_container .kw3 {color: #008000;}.ch_code_container .kw4 {color: #FF0000;}.ch_code_container .kw5 {color: #000000;}.ch_code_container .co1 {color: #008080; font-style: italic;}.ch_code_container .co2 {color: #008080;}.ch_code_container .coMULTI {color: #008080; font-style: italic;}.ch_code_container .es0 {color: #008080; font-weight: bold;}.ch_code_container .br0 {color: #008000;}.ch_code_container .st0 {color: #808080;}.ch_code_container .nu0 {color: #FF0000;}.ch_code_container .me1 {color: #0000FF;}.ch_code_container .me2 {color: #0000FF;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">MakeObjectReactiveHelper _reactiveHelper;</p>
<p><span class="kw1">public</span> MainViewModel<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; _reactiveHelper = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span class="kw3">new</span></a> MakeObjectReactiveHelper<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="coMULTI">/* More stuff */</span><br />
<span class="br0">&#125;</span></div>
<p>
<b>Step 3:</b> Paste in the following code at the end of your class, which just uses _reactiveHelper to implement the entire interface:
</p>
<p>
<script src="https://gist.github.com/902612.js?file=gistfile1.cs"></script>
</p>
<h2>An important caveat about MakeObjectReactiveHelper</h2>
<p>
One thing that probably won&#8217;t affect you, but it might: MakeObjectReactiveHelper doesn&#8217;t properly completely implement IReactiveNotifyPropertyChanged unless you are also implementing INotifyPropertyChang<b>ing</b> &#8211; most ViewModel implementations don&#8217;t (in fact, the interface doesn&#8217;t even exist in Silverlight or WP7). This means that in certain circumstances when you use the WhenAny or ObservableForProperty with a deep path (i.e. x.Foo.Bar.Baz), you may get duplicate notifications. In practice, this usually isn&#8217;t a big deal.
</p>
<h2>Watching ObservableCollections to create ViewModel collections</h2>
<p>
With RxUI 2.2, you can easily create a collection which tracks an existing collection, even if the source is an ObservableCollection. Here&#8217;s the syntax:
</p>
<p>
<script src="https://gist.github.com/902622.js?file=gistfile1.cs"></script>
</p>
<h2>Creating ReactiveCommands like RelayCommands</h2>
<p>
Unfortunately, the story for ICommand isn&#8217;t as easy, you have to wrap commands one-at-a-time in order to subscribe to them. 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: #0600FF;}.ch_code_container .kw2 {color: #FF8000; font-weight: bold;}.ch_code_container .kw3 {color: #008000;}.ch_code_container .kw4 {color: #FF0000;}.ch_code_container .kw5 {color: #000000;}.ch_code_container .co1 {color: #008080; font-style: italic;}.ch_code_container .co2 {color: #008080;}.ch_code_container .coMULTI {color: #008080; font-style: italic;}.ch_code_container .es0 {color: #008080; font-weight: bold;}.ch_code_container .br0 {color: #008000;}.ch_code_container .st0 {color: #808080;}.ch_code_container .nu0 {color: #FF0000;}.ch_code_container .me1 {color: #0000FF;}.ch_code_container .me2 {color: #0000FF;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw1">public</span> <span class="kw1">static</span> ReactiveCommand WrapCommand<span class="br0">&#40;</span>ICommand cmd<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> ReactiveCommand.<span class="me1">Create</span><span class="br0">&#40;</span>cmd.<span class="me1">CanExecute</span>, cmd.<span class="me1">Execute</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2011/04/04/using-reactiveui-with-mvvm-light-or-any-other-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

