添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
安静的西瓜  ·  RTX ...·  3 月前    · 
一身肌肉的咖啡  ·  家长祭奠 ...·  6 月前    · 
酷酷的打火机  ·  (PDF) History of ...·  7 月前    · 

There is no implemented flag or the right event to detect, if the input comes from a user (by keyboard and mouse)?

Depending on the CombobBox Item and a ListView selection, different pages are loaded in a frame and the selection of the ComboBox is saved. So i would have to encapsulate the page loadings. Usually there was a SelectionChangedCommitted in WinForms which would make it easier.

I can't find something. I thought maybe SelectionChangedTrigger could be something, but I don't see any difference between Always and Committed.

ComboBox Class

In WPF, there is no specific event or flag to detect if an input comes from a user or not. One way to achieve this is to handle the SelectionChanged event of the ComboBox and check the Source property of the SelectionChangedEventArgs. The Source property will tell you which element raised the event, and you can use this to determine if the event was raised by the user or programmatically.

Here is an example of how you can handle the SelectionChanged event and check the Source property:

private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    if (e.Source is ComboBox)
        // The event was raised by the user
        // The event was raised programmatically