From 8316abc300d56f876a5fe3b511dc202556ad776c Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 24 Oct 2012 23:38:06 +0400 Subject: loading data on scrolling at bottom --- Juick/Classes/DelegateCommand.cs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Juick/Classes/DelegateCommand.cs (limited to 'Juick/Classes/DelegateCommand.cs') diff --git a/Juick/Classes/DelegateCommand.cs b/Juick/Classes/DelegateCommand.cs new file mode 100644 index 0000000..cc7adcd --- /dev/null +++ b/Juick/Classes/DelegateCommand.cs @@ -0,0 +1,37 @@ +using System; +using System.Windows.Input; + +namespace Juick.Classes +{ + public class DelegateCommand : ICommand + { + readonly Action action; + readonly Func canExecute; + + public DelegateCommand(Action execute, Func canExecute) + { + this.action = execute; + this.canExecute = canExecute; + } + + public bool CanExecute(object parameter) + { + return canExecute(); + } + + public event EventHandler CanExecuteChanged; + + public void Execute(object parameter) + { + action(); + } + + public void NotifyCanExecuteChanged() + { + if (CanExecuteChanged != null) + { + CanExecuteChanged(this, EventArgs.Empty); + } + } + } +} -- cgit v1.2.3