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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:40:41+00:00 2026-06-03T15:40:41+00:00

I created UserControl(Button) in Expression Blend XAML: <UserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 mc:Ignorable=d x:Class=Marica.FullClient.Graphics.Node

  • 0

I created UserControl(Button) in Expression Blend

XAML:

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="Marica.FullClient.Graphics.Node"
x:Name="UserControl" Height="360" Width="500" Margin="40">

<UserControl.Resources>
    <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="rectangle">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="rectangle" Stroke="Red" Fill="{TemplateBinding Background}"/>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="StrokeThickness" TargetName="rectangle" Value="13"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="StrokeThickness" TargetName="rectangle" Value="13"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False"/>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</UserControl.Resources>

<Grid x:Name="LayoutRoot">
    <Button Name="NodeButton" Style="{DynamicResource ButtonStyle1}"/>
    <StackPanel Orientation="Vertical">
        <TextBlock
        x:Name="NodeName"
        x:FieldModifier="public"
        Text="Property"
        Margin="8,100,8,8"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        TextWrapping="Wrap" 
        TextAlignment="Center"
        FontFamily="Segoe Print"
        FontWeight="Bold" 
        Foreground="White"
        FontSize="50"/>

        <TextBlock
        x:Name="CategoryName"
        x:FieldModifier="public"
        Text="Property"
        Margin="8"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        TextWrapping="Wrap" 
        TextAlignment="Center"
        FontFamily="Segoe Print"
        FontWeight="Bold" 
        Foreground="White"
        FontSize="25"/>
    </StackPanel>
</Grid>

When I hoovered it over the control, the stroke width becomes bigger, but when I click, nothing happens.

  • 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-03T15:40:42+00:00Added an answer on June 3, 2026 at 3:40 pm

    I expect that on IsPressed you wanted to do the Easing animation, and it does not appear to be working. Well, good news, your animation fires fine, you just need to tune it to do what you want in order to see that it’s actually working. Play with KeyTime and Value

    For example, change it to:

    <EasingDoubleKeyFrame KeyTime="00:00:02" Value="30" />
    

    and you will see it starting to work/do more

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

Sidebar

Related Questions

I have created a UserControl as follows: <UserControl x:Class=MySample.MyControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:local=using:MySample xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
I've created a WPF UserControl which contains a Button. I now want any consumer
This is my UserControl created in Blend: <StackPanel Orientation=Horizontal Background=#FF0084FF Height=400> <TextBlock TextWrapping=Wrap Margin=10,0,20,0
I have created a WFP UserControl with some complex XAML (converted from SVG). It's
I've created a custom UserControl which is some kind of virtual keyboard button. I'm
I've created a WPF UserControl which contains a Button and a ComboBox. I'd like
I have created a usercontrol which is basically a button with some nice little
I created a usercontrol which contains a Canvas and a Button on the Canvas.
I have created a UserControl which has a button inside and also a style
I have created a usercontrol (a custom button control), how to apply skin on

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.