Closed bob53050 closed 9 months ago
I have been working through an example that found on stack overflow with a WPF treeview and attempting to attach to a RelayCommand using MicrosoftCommunityToolkit.mvvm and .Net 7 but I can't seem to consistently get the command to fire.
<i:Interaction.Triggers> <i:EventTrigger EventName="SelectedItemChanged"> <i:InvokeCommandAction Command="{Binding TreeViewDirectoryItemCommand}" CommandParameter=" {Binding ElementName=DirectoryTree ,Path=SelectedItem}"/> </i:EventTrigger> </i:Interaction.Triggers>
in C#
[RelayCommand] void TreeViewDirectoryItem(object parameter) { string bob = "ok"; string name = parameter.GetType().Name; }
Any thoughts would be appreciated,
Bob
There are no known issues. Since no reproduction app was provided, this issue is being closed.
I have been working through an example that found on stack overflow with a WPF treeview and attempting to attach to a RelayCommand using MicrosoftCommunityToolkit.mvvm and .Net 7 but I can't seem to consistently get the command to fire.
<i:Interaction.Triggers> <i:EventTrigger EventName="SelectedItemChanged"> <i:InvokeCommandAction Command="{Binding TreeViewDirectoryItemCommand}" CommandParameter=" {Binding ElementName=DirectoryTree ,Path=SelectedItem}"/> </i:EventTrigger> </i:Interaction.Triggers>
in C#
[RelayCommand] void TreeViewDirectoryItem(object parameter) { string bob = "ok"; string name = parameter.GetType().Name; }
Any thoughts would be appreciated,
Bob