<ListBoxItem
    x:Class="Wallet.Avalonia.ItemNavigationView"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vm="using:Wallet"
    x:DataType="vm:ItemNavigationViewModel"
    ListBoxExtension.IsItemInvokedEnabled="True">
    <ListBoxItem.Resources>
        <SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" />
    </ListBoxItem.Resources>
    <Interaction.Behaviors>
        <AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}">
            <NavigateAction
                Region="{Binding Named, StringFormat='{}{0}:Content'}"
                Route="Item"
                Scope="self">
                <Parameter Key="Name" Value="{Binding Name}" />
                <Parameter Key="FromCategory" Value="{x:False}" />
                <Parameter Key="Favourite" Value="{Binding Favourite}" />
                <Parameter Key="Archived" Value="{Binding Archived}" />
                <Parameter Key="State" Value="{x:Static vm:ItemState.Read}" />
                <Parameter Key="IsBackStackEnabled" Value="{x:False}" />
                <Parameter Key="ClearBackStack" Value="{x:True}" />
            </NavigateAction>
        </AttachedEventTriggerBehaviour>
    </Interaction.Behaviors>
    <Grid
        Margin="0,6,6,6"
        Background="Transparent"
        ColumnDefinitions="40,*">
        <Grid Grid.Column="0">
            <PersonPicture Height="40" DisplayName="{Binding Name}" />
            <TextBlock
                Margin="0,0,0,-2"
                HorizontalAlignment="Right"
                VerticalAlignment="Bottom"
                FontFamily="{DynamicResource FluentThemeFontFamily}"
                FontSize="16"
                Foreground="{DynamicResource StarredIconForegroundBrush}"
                IsVisible="{Binding Favourite}"
                Text="&#xEF60;" />
        </Grid>
        <StackPanel Grid.Column="1" Margin="12,0,0,0">
            <TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
            <TextBlock Opacity="0.7" Text="{Binding Name}" />
        </StackPanel>
    </Grid>
</ListBoxItem>
