0
位于网格行内。WPF组合框鼠标选择事件未被触发
问题是我没有得到鼠标选择的任何comboboxitem没有被解雇。但是从关键董事会来看,keydown事件正在被解雇并且工作得很好。
所以,任何想法,为什么下面的XAML组合框不会触发mousedown或selectionItem事件。
<ComboBox Name="StatusCombo" VerticalAlignment="Center" MouseDown="StatusCombo_MouseDown"
Margin="10,0,0,0" Width="Auto" MinWidth="75"
FontFamily="Arial" FontSize ="10px" FontWeight ="Normal"
SelectedIndex="{Binding IndexForSelectedStatus}"
SelectedItem="{Binding SelectedItemStatus, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=StatusComboCollection,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Style="{StaticResource UIRefreshButtonComboBoxStyle}"
AutomationProperties.Name="{Binding ElementName=labelStatus,Path=Content}">
</ComboBox>
您是否遵循经典模式/ MVVM? –
尝试预览鼠标下降https://social.msdn.microsoft.com/Forums/en-US/61807025-d4c4-41e0-b648-b11183065009/mousedown-event-not-working-wpf?forum=wpf –
也许GridRow是将鼠标放下事件尝试PreviewMOuseDown @CaseyPrice如何说出 – Jamaxack