void PrepareBehavior(string command, string functionName, object source = null, string canExecuteFunction = null, string commandParameter = "CommandParameter", bool attachToView = true) {
     Behavior = new MethodToCommandBehavior();
     Behavior.Command = command;
     Behavior.Method = functionName;
     Behavior.CanExecuteFunction = canExecuteFunction;
     Behavior.CommandParameter = commandParameter;
     Behavior.Source = source;
     if(attachToView)
         Interaction.GetBehaviors(Button).Add(Behavior);
 }
示例#2
0
 void PrepareBehavior(string command, string functionName, object source = null, string canExecuteFunction = null, string commandParameter = "CommandParameter", bool attachToView = true)
 {
     Behavior                    = new MethodToCommandBehavior();
     Behavior.Command            = command;
     Behavior.Method             = functionName;
     Behavior.CanExecuteFunction = canExecuteFunction;
     Behavior.CommandParameter   = commandParameter;
     Behavior.Source             = source;
     if (attachToView)
     {
         Interaction.GetBehaviors(Button).Add(Behavior);
     }
 }
示例#3
0
 protected override void TearDownCore()
 {
     Behavior = null;
     Button   = null;
     base.TearDownCore();
 }
 protected override void TearDownCore() {
     Behavior = null;
     Button = null;
     base.TearDownCore();
 }