title: create easing function programmatically C#
body: <p>I am learning how to create animations with C#. so if I am animating the margin of an object for example then I would use the following method to animate its margin:</p>
  
  <pre><code>test(someObject, FrameworkElement.MarginProperty);
  
  /// &lt;summary&gt;
  /// animate margin of an object
  /// &lt;/summary&gt;
  /// &lt;param name="target"&gt;what object do you whant to animate?&lt;/param&gt;
  /// &lt;param name="property"&gt;what property do you want to animate&lt;/param&gt;
  public void test(DependencyObject target, DependencyProperty property)
  {
      ThicknessAnimation animation = new ThicknessAnimation();
      animation.To = new Thickness(0,0,0,0);   // final value
  
      //animation.From = new Thickness(50,50,50,50);
  
      //make animation last 5 seconds
      animation.BeginTime = TimeSpan.FromSeconds(0);
      animation.Duration = TimeSpan.FromSeconds(5);
  
      // set the ease function
      BounceEase b = new BounceEase();
      animation.EasingFunction = b;
  
      //note that I would like to add an easeIn function
  
      //start animating
      Storyboard.SetTarget(animation, target);  // what object will be animated?
      Storyboard.SetTargetProperty(animation, new PropertyPath(property)); // what property will be animated
      Storyboard sb = new Storyboard();
      sb.Children.Add(animation);
      sb.Begin();
  }
  </code></pre>
  
  <p>note that I am able to create a ease function. But what if I want to create an EaseInOut easing function. what do I have to add to my test method in order to animate the object using an EaseInOut approach.</p>