Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8255157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:25:43+00:00 2026-06-08T01:25:43+00:00

I created a templated hyperlinkbutton in wpf (windows 8 metro app): <ControlTemplate TargetType=HyperlinkButton> <HyperlinkButton>

  • 0

I created a templated hyperlinkbutton in wpf (windows 8 metro app):

<ControlTemplate TargetType="HyperlinkButton">
<HyperlinkButton>
    <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
            <VisualStateGroup.Transitions>
                <VisualTransition To="PointerOver" GeneratedDuration="0:0:0.1"/>
            </VisualStateGroup.Transitions>                
        </VisualStateGroup>
        <VisualState x:Name="Normal"/>
        <VisualState x:Name="PointerOver">
            <Storyboard>
                <ColorAnimation Storyboard.TargetName="HyperlinkForegroundBrush" Storyboard.TargetProperty="Color" To="#FF011751"/>
            </Storyboard>
        </VisualState>
    </VisualStateManager.VisualStateGroups>
    <ContentPresenter Content={TemplateBinding Content}>
        <ContentPresenter.Foreground>
            <SolidColorBrush x:Name="HyperlinkForegroundBrush" Color="3FFB20404"/>
        </ContentPresenter.Foreground>
    </ContentPresenter>
</HyperlinkButton>

and this is the hyperlinkbutton::

<HyerlinkButton Style={StaticResource MainPageLinkStyle} x:Name="MoreDetailsHyperlinkButton" Content="More..." Click="MoreDetailsHyperlinkButton_Click"/>

The style MainPageLinkStyle refers to the above style mentioned.

Problem: The click of the hyperlinkbutton doesn’t gets executed.

Please help.

Thanks in advance.

EDIT:
Instead of hyperlinkbutton’s click event, when I use PointerPressed event, the mouse right click triggers this event,but not the mouse left click….Seems strange to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:25:44+00:00Added an answer on June 8, 2026 at 1:25 am

    I found the solution. Here’s the modified markup:

    <ControlTemplate TargetType="HyperlinkButton">
    <**Border**>
        <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition To="PointerOver" GeneratedDuration="0:0:0.1"/>
                    </VisualStateGroup.Transitions>                
                </VisualStateGroup>
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="PointerOver">
                    <Storyboard>
                            <ColorAnimation Storyboard.TargetName="HyperlinkForegroundBrush" Storyboard.TargetProperty="Color" To="#FF011751"/>
                        </Storyboard>
                </VisualState>
            </VisualStateManager.VisualStateGroups>
            <ContentPresenter Content={TemplateBinding Content}>
                <ContentPresenter.Foreground>
                        <SolidColorBrush x:Name="HyperlinkForegroundBrush" Color="3FFB20404"/>
                </ContentPresenter.Foreground>
            </ContentPresenter>
    </**Border**>
    

    As highlighted in the markup, I need to use Border class instead of Hyperlink. I am not able to understand why, but this seems to be a possible solution working for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a TabControl in a WPF application I'm writing. I re-templated TabItem
I have created a very simple wpf app with mvvm light. I have rows
Is there some trick that I'm missing here? I've created a templated control, very
My app uses Core Data, I used the CoreData template when created my project
I've created a templated class, and it works fine: ( I'm using openCV library,
I have created infopath form library in SharePoint sever2010. I am using Windows server
I have created a custom map for an assignment (It's a generic templated map
I am new to Vaadin. I have created template for my web application in
I have been trying to find a good guide to create a templated control.
I'm using the single page application template in MVC 4. The template created the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.