Skip to content

AniiatedNavigationBar CommandParameter for SelectionChanged via Behavior always receives null #19

@tmdgjs9525

Description

@tmdgjs9525

Environment:

OS: Windows 11

.NET Version: .NET 9.0

Controlskit Version: 3.3.0-preview-2025-07-03-073025-fa05b44

I tried changing the CommandParameter in various ways, but the result was the same.

`[ObservableProperty]
private ObservableCollection _tabs = new() { "Home", "Tech", "Life" };

[RelayCommand]
private void TabChanged(object item)
{
    // This breakpoint is only ever hit with 'item' as null.
    Debug.WriteLine(item == null ? "Received null" : $"Received: {item}");
}`

`<controlskit:AnimatedNavigationBar IndicatorCornerRadius="10" ItemsSource="{Binding Tabs}">

<i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
        <i:InvokeCommandAction Command="{Binding TabChangedCommand}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=controlskit:AnimatedNavigationBar}}" />
    </i:EventTrigger>
</i:Interaction.Triggers>
<controlskit:AnimatedNavigationBar.ItemTemplate>
    <DataTemplate>
        <TextBlock Text="{Binding .}"/>
    </DataTemplate>
</controlskit:AnimatedNavigationBar.ItemTemplate>

</controlskit:AnimatedNavigationBar>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions