-
- ttermeer-reboundcg
- Posts: 31
- Joined:
- Contact:
Interaction Triggers no longer working in 3.1.x
In the process of updating NoesisGUI from 3.0.x, we noticed some interaction are no longer working.
The following code no longer work in 3.1.0 and 3.1.1 (with Unity 2020.3)
There is no visible error in logs. The behavior works under WPF and previous version of Noesis.
The following code no longer work in 3.1.0 and 3.1.1 (with Unity 2020.3)
There is no visible error in logs. The behavior works under WPF and previous version of Noesis.
Code: Select all
<ListView ItemsSource="{Binding Players}" x:Name="PlayersRankingView" Margin="20,10,20,10">
<ListView.View>
<GridView>
<GridViewColumn Width="130">
<GridViewColumnHeader Content="Test"/>
</GridViewColumn>
</GridView>
</ListView.View>
<b:Interaction.Triggers>
<b:EventTrigger EventName="MouseLeftButtonUp">
<b:InvokeCommandAction Command="{Binding PlayerClickCommand}" CommandParameter="{Binding ElementName=PlayersRankingView, Path=SelectedItem}"/>
</b:EventTrigger>
</b:Interaction.Triggers>
</ListView>-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Interaction Triggers no longer working in 3.1.x
In 3.1 version some controls react to the mouse up event instead of mouse down to work better along with touch and manipulations. The ListBoxItem now does the selection during mouse up and handles the event, so it won't reach the parent control and its triggers. You can just listen to PreviewMouseUp/PreviewMouseLeftButtonUp instead.
Could that work for you?
Could that work for you?
-
- ttermeer-reboundcg
- Posts: 31
- Joined:
- Contact:
Re: Interaction Triggers no longer working in 3.1.x
This won't work because Preview will happen before SelectedItem is set in the ListView. This behavior seems specific to Noesis as in WPF, it still work as intended with Preview.
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Interaction Triggers no longer working in 3.1.x
If you are interested in the SelectedItem, won't be easier to just bind to that property in the ListView instead of using a command and bind to the SelectedItem in the parameter?
Code: Select all
<ListView x:Name="PlayersRankingView" ItemsSource="{Binding Players}" SelectedItem="{Binding SelectedPlayer}" Margin="20,10,20,10">-
- ttermeer-reboundcg
- Posts: 31
- Joined:
- Contact:
Re: Interaction Triggers no longer working in 3.1.x
Yes this works. Not sure what was the reason it was done this way.
Who is online
Users browsing this forum: No registered users and 2 guests