-
Notifications
You must be signed in to change notification settings - Fork 140
CallMethodAction
branh edited this page Dec 3, 2018
·
3 revisions
CallMethodAction represents an action which, when triggered, calls a method on a specified object.
Using this Behavior allows the specified MethodName
to be called on TargetObject
.
<Button x:Name="button">
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="Click" SourceObject="{Binding ElementName=button}">
<Behaviors:CallMethodAction TargetObject="{Binding}" MethodName="IncrementCount"/>
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
</Button>
public int Count { get; set; }
public void IncrementCount()
{
Count++;
OnPropertyChanged(nameof(Count));
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
- Introduction
- Contribution
- Behaviors Reference
- CallMethodAction
- ChangePropertyAction
- ConditionBehavior
- ControlStoryboardAction
- DataStateBehavior
- FluidMoveBehavior
- FluidMoveSetTagBehavior
- GoToStateAction
- InvokeCommandAction
- LaunchUriOrFileAction
- MouseDragElementBehavior
- PlaySoundAction
- RemoveElementAction
- SetDataStoreValueAction
- TranslateZoomRotateBehavior