Click here to Skip to main content
15,898,134 members

Comments by XiaoChuan Yu (Top 3 by date)

XiaoChuan Yu 4-Aug-11 12:43pm View    
Deleted
Good idea. I've updated my tip to set HandleEventsToo in XAML. I also added a paragraph about your second comment and modified my initial XAML a bit to demonstrate. If I have time, I will make a class as you described probably using AttachedProperty. I probably won't add it to this Tip since its quite long already.
XiaoChuan Yu 30-Jul-11 13:20pm View    
Deleted
Thanks, you made some very good points especially about using MouseDown with HandleEventsToo flag instead of PreviewMouseDown. I've updated my tip. Please look at the middle section and ending section. I kinda edited it in hurry; hope I didn't make any mistakes.
XiaoChuan Yu 27-Jul-11 18:49pm View    
Deleted
Hi, thanks for the comment. Sorry I didn't make it clear that I wanted the "built-in" handler of the control to handle the event; not handle it myself. What I forgot to say in my tip was that I needed multiple selection in my ListView and I didn't want to implement that logic myself in a handler (by using HandleEventsToo parameter in UIElement.AddHandler(...) like you said). I needed the user to be able select text in cells as well as select multiple rows with Ctrl+ or Shift+ with mouse or with arrow keys. This is the reason why I came up with the hacky solution I posted. I will revise my tip to make it clearer. Please re-vote if you think what I've said here is credible, thanks.