Wednesday, April 13, 2011

WPF: Make Whole Border Clickable

I'm trying to implement a button in WPF which shows a menu when you click it. I've got everything working, and the ControlTemplate for the control is shown below. (The control extends ToggleButton).

<Border x:Name="Border" Padding="3" CornerRadius="1" BorderThickness="1"
    VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsHitTestVisible="True">

The problem is, the menu is only shown when the user clicks the tiny arrow drawn by the path. Is there any way I can make the whole border HitTestVisible?

From stackoverflow
  • Adding a transparent background on it should do it.

    Echilon : That worked perfectly. Thanks. :)

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.