﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Mike Minutillo commented on Conditions and facts</title><description>Fair point :)
</description><link>http://ayende.com/4113/conditions-and-facts#comment10</link><guid>http://ayende.com/4113/conditions-and-facts#comment10</guid><pubDate>Thu, 20 Aug 2009 12:16:42 GMT</pubDate></item><item><title>Ayende Rahien commented on Conditions and facts</title><description>Mike,
  
I wouldn't call 2 if statements all over, but yes, I could have done that
</description><link>http://ayende.com/4113/conditions-and-facts#comment9</link><guid>http://ayende.com/4113/conditions-and-facts#comment9</guid><pubDate>Thu, 20 Aug 2009 12:10:27 GMT</pubDate></item><item><title>Mike Minutillo commented on Conditions and facts</title><description>Could you possibly make the Command code even simpler if you used the Null Value Pattern to have your infrastructure insert a Fact that is always true instead of checking for null all over?
</description><link>http://ayende.com/4113/conditions-and-facts#comment8</link><guid>http://ayende.com/4113/conditions-and-facts#comment8</guid><pubDate>Thu, 20 Aug 2009 11:48:13 GMT</pubDate></item><item><title>Ayende Rahien commented on Conditions and facts</title><description>Yes, I have seen that.
</description><link>http://ayende.com/4113/conditions-and-facts#comment7</link><guid>http://ayende.com/4113/conditions-and-facts#comment7</guid><pubDate>Mon, 10 Aug 2009 16:56:06 GMT</pubDate></item><item><title>Doron Yaacoby commented on Conditions and facts</title><description>Ayende,
  
Have you looked into the new Rx Framework which seems to be doing similar things over Linq?
  
  
[themechanicalbride.blogspot.com/.../...events.html](http://themechanicalbride.blogspot.com/2009/07/introducing-rx-linq-to-events.html)</description><link>http://ayende.com/4113/conditions-and-facts#comment6</link><guid>http://ayende.com/4113/conditions-and-facts#comment6</guid><pubDate>Mon, 10 Aug 2009 15:39:23 GMT</pubDate></item><item><title>Peter Morris commented on Conditions and facts</title><description>I used this:
  
  
	public class ActionCommand : ICommand
  
	{
  
		readonly Action
&lt;object Action;
  
		public event EventHandler CanExecuteChanged;
  
  
		public ActionCommand(Action
&lt;object action)
  
		{
  
			Action = action;
  
			Enabled = true;
  
		}
  
  
		bool enabled;
  
		public bool Enabled
  
		{
  
			get { return enabled; }
  
			set
  
			{
  
				enabled = value;
  
				var canExecuteChanged = CanExecuteChanged;
  
				if (canExecuteChanged != null)
  
					canExecuteChanged(this, EventArgs.Empty);
  
			}
  
		}
  
  
		public bool CanExecute(object parameter)
  
		{
  
			return Enabled;
  
		}
  
  
		public void Execute(object parameter)
  
		{
  
			if (Action != null)
  
				Action(parameter);
  
		}
  
	}
&gt;</description><link>http://ayende.com/4113/conditions-and-facts#comment5</link><guid>http://ayende.com/4113/conditions-and-facts#comment5</guid><pubDate>Mon, 10 Aug 2009 13:57:39 GMT</pubDate></item><item><title>Ayende Rahien commented on Conditions and facts</title><description>Michael,
  
CompositeObservable to to rescue
</description><link>http://ayende.com/4113/conditions-and-facts#comment4</link><guid>http://ayende.com/4113/conditions-and-facts#comment4</guid><pubDate>Mon, 10 Aug 2009 13:51:47 GMT</pubDate></item><item><title>Ayende Rahien commented on Conditions and facts</title><description>Stephen,
  
Fact implementing INPC means that I can bind directly to it
</description><link>http://ayende.com/4113/conditions-and-facts#comment3</link><guid>http://ayende.com/4113/conditions-and-facts#comment3</guid><pubDate>Mon, 10 Aug 2009 13:51:01 GMT</pubDate></item><item><title>Michael L Perry commented on Conditions and facts</title><description>What if the condition is based on more than one observable? Say for example, CurrentPage &lt; TotalPages-1? How would you subscribe to both?
</description><link>http://ayende.com/4113/conditions-and-facts#comment2</link><guid>http://ayende.com/4113/conditions-and-facts#comment2</guid><pubDate>Mon, 10 Aug 2009 11:43:43 GMT</pubDate></item><item><title>Stephen commented on Conditions and facts</title><description>I like it, you basically encapsulate a condition and manage handling its invalidation. Although I'm not sure you need fact to be INotifyPropertyChanged, you could well just have a bog standard 'Changed' event.
  
  
Fact is nice and short as a class name but something niggles at me regarding a fact changing.. to me its more like an ObservableCondition, but obviously that doesnt sound as good ;).
</description><link>http://ayende.com/4113/conditions-and-facts#comment1</link><guid>http://ayende.com/4113/conditions-and-facts#comment1</guid><pubDate>Mon, 10 Aug 2009 10:55:57 GMT</pubDate></item></channel></rss>