
I want to completely replace the ApplicationButton but keep it's functionality. When I use a ControlTemplate with a vector graphic in it, the ApplicationButton does not work anymore.
Here is the XAML. I do not get the click event in code behind nor does it pop up an ApplicationMenu (not shown here). The ApplicationMenu I am using does work when I remove the ControlTemplate.So this works for a regular button (I get the click event in code behind):
FYI...
I also tried using a regular shared:PopupButton which does work with a ControlTemplate, but then the ApplicationMenu doesn't behavior correctly. For example, once you hover over a ribbon:SplitButton (like Save As), you then have to explicitly click back on a different menu to get back to the Recent Documents. Normally, just hovering back over something else returned you to Recent Documents.
Here is the XAML. I do not get the click event in code behind nor does it pop up an ApplicationMenu (not shown here). The ApplicationMenu I am using does work when I remove the ControlTemplate.
<ribbon:ApplicationButton x:Name="AppButton"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="AppButton_Click_3">
<ribbon:ApplicationButton.Template>
<ControlTemplate TargetType="Button">
<Path Data="M0,0 L18,24 36,0z" Stroke="Black" Fill="Black" />
</ControlTemplate>
</ribbon:ApplicationButton.Template>
</ribbon:ApplicationButton>
<Button x:Name="AppButton"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="AppButton_Click_1">
<Button.Template>
<ControlTemplate TargetType="Button">
<Path Data="M0,0 L18,24 36,0z" Stroke="Black" Fill="Black" />
</ControlTemplate>
</Button.Template>
</Button>
I also tried using a regular shared:PopupButton which does work with a ControlTemplate, but then the ApplicationMenu doesn't behavior correctly. For example, once you hover over a ribbon:SplitButton (like Save As), you then have to explicitly click back on a different menu to get back to the Recent Documents. Normally, just hovering back over something else returned you to Recent Documents.