-
Notifications
You must be signed in to change notification settings - Fork 112
CallMethodAction
Jon W Chu edited this page Nov 16, 2015
·
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">
<Interactivity:Interaction.Behaviors>
<Interactions:EventTriggerBehavior EventName="Click" SourceObject="{Binding ElementName=button}">
<Interactions:CallMethodAction TargetObject="{Binding}" MethodName="IncrementCount"/>
</Interactions:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Button>
public int Count { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public void IncrementCount()
{
Count++;
OnPropertyChanged(nameof(Count));
}
private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
- Introduction
- Using Behaviors NuGet
- Contribution
- API Reference
- Behaviors Reference
- Changelog