Skip to content

How to bind a command to an event? #6171

Discussion options

You must be logged in to vote

You can use Behaviors

Example:

<UserControl x:Class="BehaviorsTestApplication.Views.Pages.InvokeCommandActionView"
             xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:i="using:Avalonia.Xaml.Interactivity"
             xmlns:ia="using:Avalonia.Xaml.Interactions.Core"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="450">
    <Grid

Replies: 2 comments 10 replies

Comment options

wieslawsoltes
Jul 2, 2021
Collaborator Sponsor

You must be logged in to vote
7 replies
@NekrasovaLera
Comment options

@NekrasovaLera
Comment options

@ShrutiJaiswal1494
Comment options

@maxkatz6
Comment options

@NekrasovaLera
Comment options

Answer selected by NekrasovaLera
Comment options

You must be logged in to vote
3 replies
@NekrasovaLera
Comment options

@IAbstract
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants