using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Reflection;
using System.Windows;
namespace BuzzGUI.Common
{
///
/// Defines the command behavior binding
///
public class CommandBehaviorBinding : IDisposable
{
#region Properties
///
/// Get the owner of the CommandBinding ex: a Button
/// This property can only be set from the BindEvent Method
///
public DependencyObject Owner { get; private set; }
///
/// The event name to hook up to
/// This property can only be set from the BindEvent Method
///
public string EventName { get; private set; }
///
/// The event info of the event
///
public EventInfo Event { get; private set; }
///
/// Gets the EventHandler for the binding with the event
///
public Delegate EventHandler { get; private set; }
#region Execution
//stores the strategy of how to execute the event handler
IExecutionStrategy strategy;
///
/// Gets or sets a CommandParameter
///
public object CommandParameter { get; set; }
ICommand command;
///
/// The command to execute when the specified event is raised
///
public ICommand Command
{
get { return command; }
set
{
command = value;
//set the execution strategy to execute the command
strategy = new CommandExecutionStrategy { Behavior = this };
}
}
Action