Search code examples
silverlightdata-bindingsilverlight-4.0dependency-propertiessetcurrentvalue

Silverlight DependencyProperty.SetCurrentValue Equivalent


I'm looking for a SL4 equivalent to .NET 4's SetCurrentValue API, which would appear to be exactly what I need for my scenario.

In short, I'm writing an attached behavior that updates the value of a given property at appropriate times. However, I don't want it to overwrite any bindings that are set on that dependency property. I merely want to push that value to the property (and therefore have any bindings refresh based on that value).

From what I can tell, there's no easy way to do this yet in SL4.

Thanks


Solution

  • Silverlight does not provide direct access to this level of dependency value. However its this level of value that Animations in storyboards set when they manipulate a property.

    Hence a Storyboard with a 0 length duration containing a single DiscreteObjectKeyFrame might achieve your desired result.