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); }
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); } }
protected override void TearDownCore() { Behavior = null; Button = null; base.TearDownCore(); }