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

  • Home
  • SEARCH
  • 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 6122143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:51:52+00:00 2026-05-23T15:51:52+00:00

I am adding a trigger to a custom Datepicker to trigger a popup textblock.

  • 0

I am adding a trigger to a custom Datepicker to trigger a popup textblock.

However, when i run the code, i get an unhandled nullreferenceexception.

if i remove the trigger, everything works fine.

<Grid.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
        <Setter TargetName="Popup_PrevButton" Property="IsOpen" Value="True" />
        <Setter TargetName="Popup_NextButton" Property="IsOpen" Value="True" />
    </Trigger>
    <Trigger Property="IsMouseOver" Value="False">
        <Setter TargetName="Popup_PrevButton" Property="IsOpen" Value="False" />
        <Setter TargetName="Popup_NextButton" Property="IsOpen" Value="False" />
    </Trigger>
</Grid.Triggers>

I have tried placing the trigger in the PART_Button and ControlTemplate but nothing works.

The popup code is placed right after the PART_Popup and is as follows:

<Popup x:Name="Popup_PrevButton"
       PlacementTarget="{Binding ElementName=PART_Button}"
       IsOpen="False"
       Placement="Left" 
       StaysOpen="False"
       AllowsTransparency="True" 
       PopupAnimation="Fade"
       Focusable="True">
    <StackPanel>
       <Border Background="LightYellow">
             <TextBlock>Show Custom Rext</TextBlock>
       </Border>
    </StackPanel>
</Popup>

what is giving the error?

  • 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-23T15:51:53+00:00Added an answer on May 23, 2026 at 3:51 pm

    Triggers of an element only support EventTrigger so you can’t use property triggers (Trigger). Look FrameworkElement.Triggers Property.

    <Grid.Triggers>
        <EventTrigger RoutedEvent="UIElement.MouseEnter">
            <BeginStoryboard>
                <Storyboard>
                    <BooleanAnimationUsingKeyFrames 
                        Storyboard.TargetName="Popup_PrevButton" 
                        Storyboard.TargetProperty="IsOpen">
    
                        <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                    </BooleanAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Grid.Triggers>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a collapsible TitleWindow popup by adding a handle to the
I need to trigger code on the server side to be called when a
I have written a trigger that I want to use for adding the date
How to trigger onclick event after received return value from popup aspx which using
In my implementation, I had to add a custom label to the cell. However,
Custom values to Context Menu Items in JQgrid contains great sample about adding context
How do you set a custom MarkupExtension from code? You can easily set if
I'm toying with the idea of adding a remote-run (personal build) for Mercurial ability
Adding an element to the head of an alist (Associative list) is simple enough:
Adding source files more than one directory away (e.g. ../../source.cpp or ../../../somewhere_else/source.cpp, vs. just

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.