Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 374
Echilon Avatar asked Mar 11 '09 08:03

Echilon


1 Answers

Adding a transparent background on it should do it.

like image 159
Steven Robbins Avatar answered Sep 20 '22 16:09

Steven Robbins