<ListBoxItem
    x:Class="Wallet.Avalonia.WalletNavigationView"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="using:FluentAvalonia.UI.Controls"
    xmlns:vm="using:Wallet"
    x:DataType="vm:WalletNavigationViewModel"
    ListBoxExtension.IsItemInvokedEnabled="True"
    ToolTip.Tip="{Binding Name}">
    <Interaction.Behaviors>
        <DataTriggerBehavior Binding="{Binding IsOpened}" Value="False">
            <ConditionAction>
                <ConditionAction.Condition>
                    <ConditionalExpression ForwardChaining="And">
                        <ComparisonCondition LeftOperand="{Binding IsSelected}" RightOperand="True" />
                    </ConditionalExpression>
                </ConditionAction.Condition>
                <NavigateAction Region="Main" Route="OpenWallet">
                    <Parameter Key="Name" Value="{Binding Name}" />
                </NavigateAction>
            </ConditionAction>
        </DataTriggerBehavior>
        <AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}">
            <ConditionAction>
                <ConditionAction.Condition>
                    <ConditionalExpression ForwardChaining="And">
                        <ComparisonCondition LeftOperand="{Binding IsOpened}" RightOperand="False" />
                    </ConditionalExpression>
                </ConditionAction.Condition>
                <NavigateAction Region="Main" Route="OpenWallet">
                    <Parameter Key="Name" Value="{Binding Name}" />
                </NavigateAction>
            </ConditionAction>
        </AttachedEventTriggerBehaviour>
    </Interaction.Behaviors>
    <PersonPicture Height="40" DisplayName="{Binding Name}" />
</ListBoxItem>