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