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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:17:23+00:00 2026-05-18T00:17:23+00:00

I have two animations defined in my silverlight app : <Storyboard x:Name=ShowControls> <DoubleAnimation Duration=0:0:0.2

  • 0

I have two animations defined in my silverlight app :

<Storyboard x:Name="ShowControls">
    <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="SlideOutMenu" />
</Storyboard>
<Storyboard x:Name="Hide-Controls">
    <DoubleAnimation Duration="0:0:0.2" To="180" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="SlideOutMenu" />
</Storyboard> 

When these Storyboards are defined in an external styles xaml file they dont work. I havent been able to figure out why I cant programmatically access these resources.

This code works for other resource types like brushes and templates so… I suspect that this resource dictionary issue is specific to Resources of the type Storyboard.

This is the code that throws the error:
(SlideOutMenu is a Border Control).

public void AddEventHandlers()
        {
            SlideOutMenu.MouseEnter += new MouseEventHandler(SlideOutMenu_MouseEnter);
            SlideOutMenu.MouseLeave += new MouseEventHandler(SlideOutMenu_MouseLeave);
        }

        public void SlideOutMenu_MouseEnter(object sender, MouseEventArgs e)
        {

            Storyboard showMenu = Application.Current.Resources["ShowControls"] as Storyboard;
            showMenu.Begin();
        } 

Any Ideas ?

  • 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-18T00:17:23+00:00Added an answer on May 18, 2026 at 12:17 am

    There are a few things I could spot

    1- The name of the storyboard Hide-Controls is not a valid name, you need to remove the -

    2- The property you are animating is not the correct name TranslateX should be X. I assume you are using a standard TranslateTransform?

    3- You will need to wire the target property in the eventhandler.

    Here is a quick test I did

    App.xaml

    <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 x:Class="SilverlightApplication1.App"
                 >
      <Application.Resources>
        <Storyboard x:Name="ShowControls">
          <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"  />
        </Storyboard>
        <Storyboard x:Name="HideControls">
          <DoubleAnimation Duration="0:0:0.2" To="180" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"  />
        </Storyboard>
      </Application.Resources>
    </Application>
    

    MainPage.xaml

    <UserControl x:Class="SilverlightApplication1.MainPage"
        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"
        d:DesignHeight="300" d:DesignWidth="400">  
      <Canvas x:Name="LayoutRoot" Background="White" Loaded="LayoutRoot_Loaded">
        <Border x:Name="SlideOutMenu" BorderBrush="Red" BorderThickness="5">
          <Border.RenderTransform>
            <TranslateTransform X="100" />
          </Border.RenderTransform>
          <ListBox Height="200" Width="100" />
        </Border>
      </Canvas>
    </UserControl>
    

    MainPage.xaml.cs

    using System.Windows.Shapes;
    
    namespace SilverlightApplication1
    {
      public partial class MainPage : UserControl
      {
        public MainPage()
        {
          InitializeComponent();
          AddEventHandlers();
        }
    
        public void AddEventHandlers()
        {
          SlideOutMenu.MouseEnter += new MouseEventHandler(SlideOutMenu_MouseEnter);
    
        }
    
        public void SlideOutMenu_MouseEnter(object sender, MouseEventArgs e)
        {
          Storyboard showMenu = Application.Current.Resources["ShowControls"] as Storyboard;
          Storyboard.SetTarget(showMenu, SlideOutMenu);
          showMenu.Begin();      
        } 
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

WP 7.5 app. I have two Storyboard animations - one on image and another
Hello I have problem to put together animations of two separate objects to second
Possible Duplicate: jQuery delay between animations I have created two functions: One that animates
I have to perform two animations on an object simultaneously. For a number of
I have two seperate animations that are occurring, one fires on mouseenter the other
I have two animations for two layers, layer1 and layer2, each has different path.
I have two jquery animations running in two different elements. Both are triggered at
I have two locations in my app. The fist one in Europe and the
i have two animations declared in the player class, and i want to run
I have two animations that I'm trying to perform on a UILabel on 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.