I have a function triggered by a mouseUp event. Everything works fine, except that sometimes the mouseUp event is not detected.
In fact I have a listview, with items, and when I select an item it triggers a function. But not always.
<ListView Margin="4" Grid.Row="1" Grid.ColumnSpan="2" x:Name="statinfoListview"
ItemsSource="{Binding Path=ExistingStateInfos, ElementName=Window}"
SelectedItem="{Binding Path=SelectedStateInfo, ElementName=Window}">
<ListView.ItemTemplate>
<DataTemplate DataType="{x:Type States:StateInfo}">
<TextBlock Text="{Binding Path=Name}" MouseUp="ApplyStateInfoNameToState_Click" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Perhaps you pull the mouse out of the textblock before you release the button? Also note you might not be clicking the textblock if you are to the right of the text, it might help to add HorizontalContentAlignment=”Stretch” to the ListView.