12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Input;
- namespace Aitex.UI.Charting.Command
- {
- /// <summary>
- ///
- /// </summary>
- public class ChartingCommand : ICommand
- {
- public ChartingCommand(Predicate<object> CanExecute , Action<object> Execute)
- {
- _canExecute = CanExecute;
- _execute = Execute;
- }
- Predicate<object> _canExecute;
-
- Action<object> _execute;
- /// <summary>
- ///
- /// </summary>
- /// <param name="parameter"></param>
- /// <returns></returns>
- public bool CanExecute(object parameter)
- {
- if (_canExecute != null)
- return _canExecute.Invoke(parameter);
- return true;
- }
- #pragma warning disable 0067
- public event EventHandler CanExecuteChanged;
- #pragma warning restore 0067
- public void Execute(object parameter)
- {
- if (_execute != null)
- _execute.Invoke(parameter);
- }
- }
- }
|