What is the worst gotcha in WPF?
        Posted  
        
            by 
                David
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by David
        
        
        
        Published on 2011-02-10T13:26:14Z
        Indexed on 
            2011/02/11
            23:25 UTC
        
        
        Read the original article
        Hit count: 222
        
Hi,
I've started to make myself a list of "WPF gotchas": things that bug me and that I had to write down to remember because I fall for them every time....
Now, I'm pretty sure you all stumbled upon similar situations at one point, and I would like you to share your experience on the subject:
What is the gotcha that gets you all the time? the one you find the most annoying?
(I have a few issues that seem to be without explanation, maybe your submissions will explain them)
Here are a few of my "personnal" gotchas (randomly presented):
- For a MouseEvent to be fired even when the click is on the "transparent" background of a control (e.g. a label) and not just on the content (the Text in this case), the control's Background has to be set to "Brushes.Transparent" and not just "null" (default value for a label) 
- A WPF DataGridCell's DataContext is the RowView to whom the cell belong, not the CellView 
- When inside a ScrollViewer, a Scrollbar is managed by the scrollviewer itself (i.e. setting properties such as ScrollBar.Value is without effect) 
- Key.F10is not fired when you press "F10", instead you get- Key.Systemand you have to go look for- e.SystemKeyto get the- Key.F10
... and now you're on.
© Stack Overflow or respective owner