<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Rowan Beach Blog</title><link>http://www.rowanbeach.com:80/</link><description>Rowan Beach Blog</description><item><title>Reactive Extensions for .NET (Rx)</title><link>http://www.rowanbeach.com:80/ReactiveExtensionsForNETRx</link><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The pace at which Microsoft are releasing new technologies at the moment is little short of astonishing. I had heard about the reactive framework a while ago but I didn't know it had actually shipped in any form yet. I ended up finding a use for this for the first time yesterday on a Silverlight project when I noticed that System.Reactive.dll had been installed as part of the Silverlight toolkit. On this app I'm creating a domain layer that will be shared by the Silverlight application on the client side and an asp.net application on the server side. I'm using a shared code approach for this at least until Silverlight 4 is released (via Visual Studio's 'Add existing item -&amp;gt; Add as link'). I had originally thought this would preclude me from using the reactive extensions in the shared domain model but then I stumbled across this: &lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx"&gt;http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx&lt;/a&gt;. Basically Microsoft have already released the Reactive Extensions for 3 platforms - Silverlight, .NET 3.5 sp1 and .NET 4.0. So I was able to download the .NET 3.5 sp1 version and use the Reactive framework in both versions of my domain layer as I wanted to.&lt;/p&gt;
&lt;p&gt;For a basic overview of the reactive framework, check out the Microsoft devlabs site (&lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx)"&gt;http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx)&lt;/a&gt;. Here's the most pertinent quote from the front page of the site:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rx is a superset of the standard LINQ sequence operators that exposes asynchronous and event-based computations as push-based, observable&amp;nbsp; collections via the new .NET 4.0 interfaces IObservable&lt;t&gt; and IObserver&lt;t&gt;.&amp;nbsp; These are the mathematical dual of the familiar IEnumerable&lt;t&gt; and IEnumerator&lt;t&gt; interfaces for pull-based, enumerable collections in the .NET framework.&amp;nbsp;&amp;nbsp; &lt;/t&gt;&lt;/t&gt;&lt;/t&gt;&lt;/t&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here&amp;rsquo;s a simple example (with most of the non-pertinent code removed from the classes) of how I&amp;rsquo;m using the IObservableinterface where I would otherwise use a standard CLR event pattern.&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public class Plan
{
    private readonly IList&lt;surveyelement&gt; _selectedSurveyElements; private readonly Subject&lt;surveyelement&gt; _surveyElementAdded; public Plan() { SurveyElementAdded = _surveyElementAdded = new Subject&lt;surveyelement&gt;(); _selectedSurveyElements = new List&lt;surveyelement&gt;(); _assetPlans = new List&lt;assetplan&gt;(); } public IObservable&lt;surveyelement&gt; SurveyElementAdded { get; private set; } public virtual IEnumerable&lt;surveyelement&gt; SelectedSurveyElements { get { return _selectedSurveyElements; } } public void AddSurveyElement(SurveyElement surveyElement) { _selectedSurveyElements.Add(surveyElement); _surveyElementAdded.OnNext(surveyElement); } }&lt;/surveyelement&gt;&lt;/surveyelement&gt;&lt;/assetplan&gt;&lt;/surveyelement&gt;&lt;/surveyelement&gt;&lt;/surveyelement&gt;&lt;/surveyelement&gt;&lt;/pre&gt;
&lt;pre class="brush: csharp;"&gt;public class AssetPlan
{
    private readonly IList&lt;surveyelementplan&gt; _surveyElementPlans; public AssetPlan(Asset asset, Plan plan) { Asset = asset; Plan = plan; _surveyElementPlans = new List&lt;surveyelementplan&gt;(); plan.SurveyElementAdded .StartWith(plan.SelectedSurveyElements.ToArray()) .Subscribe(x =&amp;gt; _surveyElementPlans.Add(new SurveyElementPlan(x, plan))); } public Asset Asset { get; private set; } public Plan Plan { get; private set; } public IEnumerable&lt;surveyelementplan&gt; SurveyElementPlans { get { return _surveyElementPlans; } } } &lt;/surveyelementplan&gt;&lt;/surveyelementplan&gt;&lt;/surveyelementplan&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The &amp;lsquo;interesting&amp;rsquo; part here, is in the constructor for AssetPlan &amp;ndash; the elements currently attached to the plan are converted to an IObservable and then concatenated with any elements that are added to the plan in the future (plan.SurveyElementAdded) and all of them are operated on inside the lambda. This would take more lines of code and be less &amp;lsquo;declarative&amp;rsquo; using an event pattern.&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:46 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/ReactiveExtensionsForNETRx</guid></item><item><title>Expression Studio</title><link>http://www.rowanbeach.com:80/ExpressionStudio</link><description>&lt;p&gt;I bought Expression Studio 3 a while back &amp;ndash; it&amp;rsquo;s really not bad at all. Expression design is not up to Adobe Illustrator standards by any means but for my purposes it&amp;rsquo;s very serviceable. Personally the only feature I really found myself wishing for after using Illustrator is the gradient mesh. Fingers crossed for gradient mesh support in Expression Design version 4&amp;hellip;&lt;/p&gt;
&lt;p&gt;I designed the new Rowan Beach logo and web site graphics with Expression Design &amp;ndash; it only took a few hours to get something looking half decent even though I was pretty new to the software (and some would say challenged from a design perspective) &amp;ndash; the software is a lot simpler than Illustrator which makes it faster to pick up and use. Partly that&amp;rsquo;s because it doesn&amp;rsquo;t have the same feature set as Illustrator but I think it&amp;rsquo;s also because it&amp;rsquo;s new software with the benefit of a clean, fresh UI design.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rowanbeach.com/content/binary/WindowsLiveWriter/ExpressionStudio_140EC/ExpressionDesign_2.png"&gt;&lt;img width="626" height="434" title="ExpressionDesign" style="display: inline; border-width: 0px;" alt="ExpressionDesign" src="http://www.rowanbeach.com/content/binary/WindowsLiveWriter/ExpressionStudio_140EC/ExpressionDesign_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Expression Blend is great for laying out Silverlight / WPF application screens (I&amp;rsquo;ve been using it mostly for Silverlight really) although it sometimes does nasty things to the XAML (e.g. it often adds negative margins all over the place when you surround something with a different layout container). If you stay in split view and keep an eye on the XAML that is being churned out it really works quite well. Overall I still tend to do a lot of layout in the visual studio XAML editor though&amp;nbsp; - the better auto-complete support with Resharper is great and being able to hit Ctrl+K, Ctrl+D to quickly reformat the XAML is very handy. I find that I normally swap back and forth between Visual Studio and Expression Blend when doing Silverlight layouts. Blend is pretty much indispensable for doing key-frame animations, especially for parts and states model transitions &amp;ndash; those would be much more of a pain to code by hand in the XAML I wonder how things will change when Visual Studio 2010 is released, as that will have GUI designer support for XAML &amp;ndash; time will tell. Oh, I should mention, Expression Blend can open Visual Studio .sln files which is really handy &amp;ndash; both apps will auto load changes made in the other app too which works well normally, although occasionally I find that I need to restart Blend as it seems to get confused by changes that have occurred in Visual Studio.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rowanbeach.com/content/binary/WindowsLiveWriter/ExpressionStudio_140EC/ExpressionBlend.png"&gt;&lt;img width="631" height="403" title="ExpressionBlend" style="display: inline; border: 0px;" alt="ExpressionBlend" src="http://www.rowanbeach.com/content/binary/WindowsLiveWriter/ExpressionStudio_140EC/ExpressionBlend_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As for the other tools in Expression studio, well I&amp;rsquo;m sure I&amp;rsquo;ll find a use for them eventually :)&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:44 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/ExpressionStudio</guid></item><item><title>ASP.NET MVC 2 Validation changes</title><link>http://www.rowanbeach.com:80/ASPNETMVC2ValidationChanges</link><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It looks like the ASP.NET MVC team have changed the way model validation will work for the upcoming version 2 of the MVC framework. This was totally in response to user feedback on Twitter and various blog posts, and while it&amp;rsquo;s a good change in itself, it&amp;rsquo;s pretty remarkable for a couple of reasons.&lt;/p&gt;
&lt;p&gt;1 &amp;ndash; It shows Microsoft are really listening to people these days&lt;/p&gt;
&lt;p&gt;2 &amp;ndash; The change seems to have been implemented in less than a week &amp;ndash; even if it&amp;rsquo;s a fairly simple change, that&amp;rsquo;s still a pretty good turnaround time for what is a fairly major component of ASP.NET MVC 2.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s Scott Gu&amp;rsquo;s post &lt;a title="http://twitter.com/scottgu/statuses/8097596794" href="http://twitter.com/scottgu/statuses/8097596794"&gt;http://twitter.com/scottgu/statuses/8097596794&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rowanbeach.com/content/binary/WindowsLiveWriter/ASP.NETMVC2Validationchanges_114A7/scott-gu-twitter-mvc-change_2.png"&gt;&lt;img width="441" height="252" title="scott-gu-twitter-mvc-change" style="display: inline; border: 0px;" alt="scott-gu-twitter-mvc-change" src="http://www.rowanbeach.com/content/binary/WindowsLiveWriter/ASP.NETMVC2Validationchanges_114A7/scott-gu-twitter-mvc-change_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And here&amp;rsquo;s Ayende&amp;rsquo;s take on the original issue &lt;a title="http://ayende.com/Blog/archive/2010/01/21/when-the-design-violates-the-principle-of-least-surprise-you.aspx" href="http://ayende.com/Blog/archive/2010/01/21/when-the-design-violates-the-principle-of-least-surprise-you.aspx"&gt;http://ayende.com/Blog/archive/2010/01/21/when-the-design-violates-the-principle-of-least-surprise-you.aspx&lt;/a&gt; which, as (almost) always, seems to make a lot of sense.&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:43 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/ASPNETMVC2ValidationChanges</guid></item><item><title>Silverlight UI thread dispatcher helper class</title><link>http://www.rowanbeach.com:80/SilverlightUIThreadDispatcherHelperClass</link><description>&lt;p&gt;A simple class to manage dispatching calls to a UI thread in a silverlight application (might work in WPF too, I haven't tried it!)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;    public static class UIThread
    {
        private static readonly Dispatcher Dispatcher;

        static UIThread()
        {
            Dispatcher = Deployment.Current.Dispatcher;
        }

        public static void Invoke(Action action)
        {
            if (Dispatcher.CheckAccess())
                action();
            else
                Dispatcher.BeginInvoke(action);
        }
    }
&lt;/pre&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:41 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/SilverlightUIThreadDispatcherHelperClass</guid></item><item><title>WCF services without adding a service reference</title><link>http://www.rowanbeach.com:80/WCFServicesWithoutAddingAServiceReference</link><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One way to avoid the spaghetti code and awkward namespaces that arise from using the Add Service Reference in Visual Studio is to extract your service interface code (including any DTO&amp;rsquo;s) into a separate assembly and share this assembly between your projects. You can also do this by referencing the same code files if you don&amp;rsquo;t want to share the assembly. Doesn&amp;rsquo;t this produce tight coupling though? Not really - you are sharing an interface, not implementation &amp;ndash; the fact that the interface is a CLR object or a few C# files rather than a WSDL file is incidental.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f6eb4309-5993-440b-b22a-66a514300f37" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;    public static class WcfServiceFactory
    {
        public static T BuildServiceProxy&amp;lt;T&amp;gt;(string serviceUri)
        {
            var basicHttpBinding = new BasicHttpBinding
                                       {
                                           MaxReceivedMessageSize = 2147483647,
                                           MaxBufferSize = 2147483647,
                                           SendTimeout = TimeSpan.FromMinutes(10),
                                           ReceiveTimeout = TimeSpan.FromMinutes(10)
                                       };

            var endpointAddress = new EndpointAddress(serviceUri);
            var service = new ChannelFactory&amp;lt;T&amp;gt;(basicHttpBinding, endpointAddress).CreateChannel();
            return service;
        }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is a sample WcfServiceFactory class you can use to create a proxy that can then be injected via your DI container (or however you decide to instantiate it).&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:40 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/WCFServicesWithoutAddingAServiceReference</guid></item><item><title>Entity Framework June 2011 CTP–enums!</title><link>http://www.rowanbeach.com:80/EntityFrameworkJune2011CTPenums</link><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The ADO.NET team at Microsoft just &lt;a href="http://blogs.msdn.com/b/adonet/archive/2011/06/30/announcing-the-microsoft-entity-framework-june-2011-ctp.aspx"&gt;announced the release of the Microsoft Entity Framework June 2011 CTP&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are a few nice features in there &amp;ndash; one that I have been looking forward to is the enum support. Until now EF could not store enum values in the DB &amp;ndash; the obvious way around this was to have a wrapper property in your entity class which exposed the enum value as an int or&amp;nbsp; whichever data type your enum is based on. This works but it is a bit messy, so baked in enum support is a welcome feature.&lt;/p&gt;
&lt;p&gt;My current work with Entity Framework is mostly based around code first so I decided to create a quick sample to see how enum support worked in code first.&lt;/p&gt;
&lt;p&gt;First I installed the bits from here &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=26660"&gt;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=26660&lt;/a&gt;. I actually only installed the EF_JUNE_2011_CTP.msi as I didn&amp;rsquo;t need any designer or tools support for this quick test &amp;ndash; it&amp;rsquo;s called code first for a reason &lt;img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" alt="Smile" src="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;h5&gt;&lt;a href="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/image_2.png"&gt;&lt;img width="555" height="385" title="image" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" alt="image" src="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/image_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/h5&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I fired up Visual Studio and created a new console app called EFEnumSupportTest. I like console apps for investigating new UI agnostic framework features as there&amp;rsquo;s barely any extraneous UI code to distract you from what you are trying to investigate.&lt;/p&gt;
&lt;p&gt;To use the EF CTP you need to change the target framework for your app to the June 2011 CTP in the properties dialog for the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/TargetFramework_2.png"&gt;&lt;img width="388" height="252" title="TargetFramework" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" alt="TargetFramework" src="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/TargetFramework_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I added a reference to the EF CTP dll which on my machine was here:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;C:\Program Files (x86)\Microsoft Entity Framework June 2011 CTP\bin\.NETFramework\System.Data.Entity.dll&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then the code. As this was a simple test I put all the code in the Program.cs file&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is the whole file&amp;hellip;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0f3413da-733c-421d-b623-bf3e77c5424f" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;using System.Data.Entity;

namespace EFEnumSupportTest
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var db = new EnumTestContext();
            db.Cars.Add(new Car {Make = "Bentley", CarType = CarType.Saloon});
            db.Cars.Add(new Car {Make = "Jaguar", CarType = CarType.Saloon});
            db.Cars.Add(new Car {Make = "Aston Martin", CarType = CarType.Saloon});
            db.Cars.Add(new Car {Make = "Land Rover", CarType = CarType.Estate});
            db.SaveChanges();
        }
    }

    public class Car
    {
        public int Id { get; set; }
        public string Make { get; set; }
        public CarType CarType { get; set; }
    }

    public enum CarType
    {
        Convertible = 1,
        Saloon = 2,
        Estate = 3
    }

    public class EnumTestContext : DbContext
    {
        public IDbSet&amp;lt;Car&amp;gt; Cars { get; set; }
    }
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Ctrl+F5 and everything works, database created, data in database. (By default this uses .\SQLEXPRESS &amp;ndash; this can be changed in the config file of course)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/CropperCapture%5B8%5D_2.png"&gt;&lt;img width="244" height="158" title="CropperCapture[8]" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" alt="CropperCapture[8]" src="http://www.rowanbeach.com/content/binary/Windows-Live-Writer/Entity-Framework_DB43/CropperCapture%5B8%5D_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Nice. Code first really does make things easy and enum support is a welcome addition. Hopefully custom conventions, second level caching and migration support will make it in there soon!&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:38 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/EntityFrameworkJune2011CTPenums</guid></item><item><title>A System.Reactive property change observer</title><link>http://www.rowanbeach.com:80/a-system.reactive-property-change-observer</link><description>&lt;p&gt;I recently read &lt;a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2011/08/11/flickr-searching-with-silverlight-amp-rx.aspx" target="_blank"&gt;Mike Taulty&amp;rsquo;s post on creating a FlickR searcher with Silverlight and Microsoft&amp;rsquo;s System.Reactive extensions&lt;/a&gt;. In his post, Mike says this about the way his property observer works: &amp;ldquo;That feels a bit weird and perhaps I should have passed a lambda into my FromPropertyChange wrapper function to grab the value from this.SearchText rather than do this?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;As we had implemented pretty much the exact the thing Mike describes in a recent project I thought I&amp;rsquo;d share it here (I was going to just post the code in the comments on Mikes blog but code snippets in blog comments rarely format well).&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll show you how to take the code that we wrote and integrate into the FlickR searcher that Mike wrote, replacing his property handler. First you&amp;rsquo;ll need to grab the code that Mike wrote &amp;ndash; it&amp;rsquo;s available from &lt;a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2011/08/11/flickr-searching-with-silverlight-amp-rx.aspx" target="_blank"&gt;his blog post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Open the ObservableEx.cs file and paste the following code into the ObservableEx class.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:1ffbb4e3-d2f6-4906-854b-1ac50421d1b6" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;        public static IObservable&amp;lt;TProperty&amp;gt; ObservePropertyChanges&amp;lt;T, TProperty&amp;gt;(this T notifyPropertyChanged, Expression&amp;lt;Func&amp;lt;T, TProperty&amp;gt;&amp;gt; property)
            where T : INotifyPropertyChanged
        {
            var propertyName = property.GetMemberInfo().Name;
            var func = property.Compile();

            var observablePropertyChanges = Observable.FromEventPattern&amp;lt;PropertyChangedEventHandler, PropertyChangedEventArgs&amp;gt;(
                h =&amp;gt; notifyPropertyChanged.PropertyChanged += h,
                h =&amp;gt; notifyPropertyChanged.PropertyChanged -= h)
                .Where(x =&amp;gt; x.EventArgs.PropertyName == propertyName)
                .Select(x =&amp;gt; func.Invoke(notifyPropertyChanged));

            return observablePropertyChanges;
        }

        public static MemberInfo GetMemberInfo(this Expression expression)
        {
            var lambda = (LambdaExpression)expression;

            MemberExpression memberExpression;
            if (lambda.Body is UnaryExpression)
            {
                var unaryExpression = (UnaryExpression)lambda.Body;
                memberExpression = (MemberExpression)unaryExpression.Operand;
            }
            else memberExpression = (MemberExpression)lambda.Body;

            return memberExpression.Member;
        }

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are 2 methods here &amp;ndash; GetMemberInfo is just a helper method to get a MemberInfo object from a Lambda expression. This is used so we can get a MemberInfo object for the property lambda. The first method, ObservePropertyChanges, is a bit more interesting &amp;ndash; we pass in an object that implements INotifyPropertyChanged (note the &amp;lsquo;this&amp;rsquo; keyword so we can use this as an extension method) and a Func Expression &amp;ndash; in practice this means we will pass a property lambda in. The method returns an IObservable for the property type we passed in.&lt;/p&gt;
&lt;p&gt;Now open up the MainViewModel.cs file and find the InitialiseSearchTextSubscription method. Comment out the code in there and paste in this code instead:&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a2e05ff9-800d-463b-b28a-e3e772101d65" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;this.ObservePropertyChanges(x =&amp;gt; x.SearchText)
                .Where(text =&amp;gt; text.Length &amp;gt; Constants.MinSearchStringLength)
                .Throttle(TimeSpan.FromMilliseconds(Constants.SearchTextTimeoutMs))
                .ObserveOnDispatcher()
                .Subscribe(OnNewSearch);

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you can see, this is pretty similar to the code Mike had already written to do the same thing. There are two main differences. First, we&amp;rsquo;re not using a &amp;lsquo;magic string&amp;rsquo; to reference the property we want to observe(SearchText in this case) &amp;ndash; we can use a strongly typed lambda &amp;ndash; with all the benefits that gives us re. compile time type checking, refactoring etc. Secondly we don&amp;rsquo;t have to &amp;lsquo;select&amp;rsquo; the property from the object we&amp;rsquo;re observing &amp;ndash; the value is passed to us in the observable sequence.&lt;/p&gt;
&lt;p&gt;Hope this is useful to someone &lt;img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" alt="Smile" src="http://www.rowanbeach.com/Media/Default/Windows-Live-Writer/37287847b32d_A06A/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:47:36 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/a-system.reactive-property-change-observer</guid></item><item><title>Orchard</title><link>http://www.rowanbeach.com:80/orchard</link><description>&lt;p&gt;I recently migrated this blog from dasBlog to the Orchard CMS. It all went pretty smoothly &amp;ndash; I followed &lt;a href="http://www.edcourtenay.co.uk/musings-of-an-idiot/migrating-to-orchard" target="_blank"&gt;the instructions here&lt;/a&gt; pretty much, and everything was fairly simple. There was nothing really wrong with dasBLog I hasten to add, I just wanted to try Orchard and this seemed like a good opportunity to do it.&lt;/p&gt;
&lt;p&gt;Blog archives don&amp;rsquo;t seem to be working at the moment, which I&amp;rsquo;ll investigate, although as I mostly use this blog for re-finding my own code snippets, it doesn&amp;rsquo;t really matter&amp;hellip; &lt;img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" alt="Smile" src="http://www.rowanbeach.com/Media/Default/Windows-Live-Writer/Orchard_D357/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Fixed that issue as per: &lt;a title="http://orchard.codeplex.com/workitem/18064" href="http://orchard.codeplex.com/workitem/18064"&gt;http://orchard.codeplex.com/workitem/18064&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now I have the next issue described here: &lt;a title="http://teelahti.fi/blog/fixing-some-orchard-cms-blog-problems" href="http://teelahti.fi/blog/fixing-some-orchard-cms-blog-problems"&gt;http://teelahti.fi/blog/fixing-some-orchard-cms-blog-problems&lt;/a&gt;&lt;/p&gt;</description><pubDate>Thu, 12 Apr 2012 21:44:21 GMT</pubDate><guid isPermaLink="true">http://www.rowanbeach.com:80/orchard</guid></item></channel></rss>
