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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:13:22+00:00 2026-05-24T04:13:22+00:00

first post. So first off, thanks for all the help over the years as

  • 0

first post. So first off, thanks for all the help over the years as I’ve learned from the sidelines. I just have a rather specific code-design question that I couldn’t find elsewhere.

I have a series of storyboards (among other things,) that relate to specific FrameworkElements, that need to be generated in the code, and I feel that it’s either a little messy, and possibly a little slow (thought I haven’t tested) to store a dictionary with the FrameworkElement – Storyboard relationships, to lookup on the fly.

    private static Dictionary<FrameworkElement, Storyboard> storyboardMapping;

    private void FrameworkElement_SizeChanged(object sender, SizeChangedEventArgs e)
    {
        FrameworkElement fe = sender as FrameworkElement;
        Storyboard sb = null;

        if(storyboardMapping.TryGetValue(fe, out sb))
        {
            sb.Begin();
        }
        // etc
    }

Having just considered using (private) Attached Dependency Properties instead, does anyone have an opinion on whether one is faster/cleaner than the other? The other downside I see to using Dictionaries, is that they also don’t work well with WeakReferences. Not being a C# Guru, I don’t completely understand whether that creates issues with Garbage Collection.

Also, I’m not exactly sure how big this Dictionary could get. Possibly up to 400 objects or even more?

  • 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-24T04:13:24+00:00Added an answer on May 24, 2026 at 4:13 am

    Rather than using either, I am now using the .Resources property of UIElements which is a much more appropriate place to store these.

    This question was previously answered, however the answer seems to have disappeared. As such I will mark this answer as the correct one unless the original reappears…

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

Sidebar

Related Questions

this is my first post, and it covers something which I've been trying to
Hey, this is my first post on stackoverflow. I'm trying to replace é with
Firstly Hello, This is my first post on this forum. I am completing a
First off, let me start by saying, I know this exact question has been
I have a Drupal site that needs to display a unique header image based
I am using Entity Framework for the first time and noticed that the entities
I warn you now very little experience at jquery. My question is this. I
I cannot get my addslashes function and html option value to play nice together.
I am trying to write a simple physics simulation where balls with varying radii
Ive been having some trouble using Plot to graph a complicated composite function. I

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.