<ListViewItem
    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">
    <ListViewItem.Resources>
        <SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" />
    </ListViewItem.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="Category" Value="{Binding Category}" />
                <Parameter Key="ImageDescriptor" Value="{Binding ImageDescriptor}" />
                <Parameter Key="FromCategory" Value="{x:False}" />
                <Parameter Key="Favourite" Value="{Binding IsFavourite}" />
                <Parameter Key="Archived" Value="{Binding IsArchived}" />
                <Parameter Key="State" Value="{x:Static vm:ItemState.Read}" />
                <Parameter Key="Transition" Value="Suppress" />
                <Parameter Key="IsBackStackEnabled" Value="{x:False}" />
                <Parameter Key="ClearBackStack" Value="{x:True}" />
            </NavigateAction>
        </AttachedEventTriggerBehaviour>
        <EventTriggerBehavior EventName="AttachedToVisualTree">
            <InvokeCommandAction Command="{Binding AttachedCommand}" />
        </EventTriggerBehavior>
    </Interaction.Behaviors>
    <Grid
        Margin="0,6,6,6"
        Background="Transparent"
        ColumnDefinitions="40,*">
        <Grid Grid.Column="0">
            <ContentBadge
                BadgePath="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z "
                BadgeSize="12"
                Foreground="{DynamicResource StarredIconForegroundBrush}"
                IsBadgeVisible="{Binding IsFavourite}">
                <PersonPicture
                    Height="40"
                    DisplayName="{Binding Name}"
                    ProfilePicture="{Binding ImageDescriptor.Image}" />
            </ContentBadge>
        </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>
</ListViewItem>
