0

The Cache object in System.Web is pretty freaking nice.

I handle my CommandBinding.CanExecute sort of like this:

CommandBindings[0].CanExecute += (s, e) =>
{
    e.CanExecute = NotInsignificantRoutine();
};

In my scenario, the return value of NotInsignificantRoutine() doesn't change inside a 5 second window. What would be the best way to cache in WPF? Import System.Web?

Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
  • Windows app based caching is available in Microsoft.Practices.EnterpriseLibrary.Caching ...that is the only non-web caching framework I am aware of! ... – WPF-it Aug 05 '11 at 04:41

1 Answers1

2

Ah, I didn't know about this; here:

The System.Runtime.Caching namespace is new in the .NET Framework 4. This namespace makes caching is available to all .NET Framework applications. In previous versions of the .NET Framework, caching was available only in the System.Web namespace and therefore required a dependency on ASP.NET classes.

http://msdn.microsoft.com/en-us/library/dd997362.aspx

Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233