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 6623699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:33:48+00:00 2026-05-25T21:33:48+00:00

I’m using the Silverlight Business Application Template but I need to customize the MainPage

  • 0

I’m using the Silverlight Business Application Template but I need to customize the MainPage layout to match the client’s existing ASP.NET projects pattern. I was able to create the Navigation menu which highlights the selected item. But when a MouseEnter event occurs, the selected menu item’s style becomes that of MouseOver VisualState. And on MouseLeave, the selected menu item turns to Normal VisualState. This behavior worked for the solution’s default menu but something may be missing from my modification. The code definition are as follows. Thanks!

<Style x:Key="NavMenuItem" TargetType="HyperlinkButton">
    <Setter Property="Foreground" Value="Black"/>
    <Setter Property="FontSize" Value="11"/>
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="Padding" Value="20,10,20,10" />
    <Setter Property="Cursor" Value="Hand"/>
    <Setter Property="MinHeight" Value="40"/>
    <Setter Property="MinWidth" Value="150"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="HyperlinkButton">
                <Grid Margin="20,20,0,0">
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <DoubleAnimation BeginTime="0" To="1" Duration="00:00:00.01" 
                                                     Storyboard.TargetName="MenuItemBorder" 
                                                     Storyboard.TargetProperty="Opacity" />
                                    <DoubleAnimation BeginTime="0" To="1" Duration="00:00:00.01" 
                                                     Storyboard.TargetName="MenuItemBorder" 
                                                     Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.ShadowDepth)" />
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Pressed">
                                <Storyboard>
                                    <DoubleAnimation BeginTime="0" To="1" Duration="00:00:00.01" 
                                                     Storyboard.TargetName="MenuItemBorder" 
                                                     Storyboard.TargetProperty="Opacity" />
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="LinkStates">
                            <VisualState x:Name="InactiveLink"/>
                            <VisualState x:Name="ActiveLink">
                                <Storyboard>
                                    <DoubleAnimation BeginTime="0" To="1" Duration="00:00:00.01" 
                                                     Storyboard.TargetName="MenuItemBorder" 
                                                     Storyboard.TargetProperty="Opacity" />
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border Name="MenuItemBorder" CornerRadius="10,0,0,10" Opacity="0" 
                            MinHeight="{TemplateBinding MinHeight}" MinWidth="{TemplateBinding MinWidth}">
                        <!--BorderBrush="Silver" BorderThickness="1"-->
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1">
                                <GradientStop Color="White" Offset="0.6"/>
                                <GradientStop Color="Silver" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Border.Effect>
                            <DropShadowEffect x:Name="BorderShadow" ShadowDepth="5" Color="#FF484848" Opacity="0.5" BlurRadius="5"/>
                        </Border.Effect>
                    </Border>
                    <ContentPresenter x:Name="ContentPresenter" 
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                          Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" />
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
            <HyperlinkButton Style="{StaticResource NavMenuItem}" NavigateUri="/Home" TargetName="ContentFrame" 
                             MouseEnter="HyperlinkButton_MouseEnterLeave" MouseLeave="HyperlinkButton_MouseEnterLeave" />
    private void HyperlinkButton_MouseEnterLeave(object sender, MouseEventArgs e) {
        HyperlinkButton hb = sender as HyperlinkButton;
        if (hb.NavigateUri.ToString() == ContentFrame.CurrentSource.ToString())
            VisualStateManager.GoToState(hb, "ActiveLink", true);
    }
  • 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-05-25T21:33:48+00:00Added an answer on May 25, 2026 at 9:33 pm

    Maybe you could try to set the MouseOver VisualSatate of your button on the EventHandler if it Event is MouseEnter and reset it if it is a MouseLeave Event.

    And i think i would set up two event handlers and not only one for both events, then you can easily set the MouseOver state and the ActiveState too.

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

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.