0

When trying to type a Routed event inside the definition of a container control (a Grid in my example), intellisense does not work. The only way I can create the Routed Event is by writing the Envent outside of the Grid properties definition area and pasting it in this area. For instance, in the XAML code snipped below, I had to paste the Button.Click="Button_Click" routed event (I couldn't even type it). How can I solve this problem? I am using both VS2012 and VS2013

 <Grid Margin="0,0,-8,-3" Button.Click="Button_Click">
    <Button Content="Button" HorizontalAlignment="Left" Margin="45,35,0,0" VerticalAlignment="Top" Width="75"/>
    <Button Content="Button" HorizontalAlignment="Left" Margin="45,61,0,0" VerticalAlignment="Top" Width="75"/>
</Grid>
user1925920
  • 43
  • 1
  • 3

1 Answers1

0

This is because Click event belongs to ButtonBase and Button just inherets it. If you write ButtonBase.Click, intellisense works. The same happens with TextBox.GotFocus and UIElement.GotFocus. I guess Microsoft implement it by this way in order to be arranged.

maralfol
  • 178
  • 6