51845

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

Answer1:

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.

Answer2:

I've managed to simulate what I'm after by detecting bindings and injecting a surrogate object between the source and target. I can then manipulate the surrogate and have both sides of the original binding refresh.

It's ugly and more work than I'd like, but it seems to work.

Kent

Recommend

  • C# “cannot assign field because it is a foreach iteration variable”
  • How to get to older Xcode beta version?
  • How can I include the Ivy dependency and none of its dependencies?
  • Azure Diagnostic is not saving logs in azure tables
  • How to force Composer to download a local package?
  • oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Invalid JWT
  • React Router and Arbitrary Query Params: Page Refreshes Unintentionally on Load?
  • OpenCV Python: Draw minAreaRect ( RotatedRect not implemented)
  • Problem in concatenation of objects in javascript
  • WP7 difficulties binding data to listbox itemssource - won't refresh
  • What does the TypeScript “lib” option really do?
  • Vigenere cipher not working
  • How do you create a Fuseki SPARQL server using the Apache Jena Java API?
  • Why doesn't a local variable live long enough for thread::scoped?
  • Is there any way to call saveCurrentTurnWithMatchData without sending a push notification?
  • Is there a Windows socket API call / option to “block” a range of ports à la SO_EXCLUSIVEADDRUSE
  • Angular Bootstrap Carousel Slide Transition not working correctly
  • How can we prepend rows to a react native list-view?
  • Can I use AllJoyn Framework for Wifi Direct in iOS?
  • Salesforce Different WSDL files and when to use
  • Low TTL with Leveled Compaction, should I reduce gc_grace_seconds to improve read performance withou
  • Zurb Foundation _global.scss meta styles for js?
  • How to use carriage return with multiple line?
  • Use of this Javascript
  • C++ Partial template specialization - design simplification
  • Control modification in presentation layer
  • Join two tables and save into third-sql
  • How to make Safari send if-modified-since header?
  • How to get next/previous record number?
  • Apache 2.4 - remove | delete | uninstall
  • How do I rollback to a specific git commit
  • Python: how to group similar lists together in a list of lists?
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Unit Testing MVC Web Application in Visual Studio and Problem with QTAgent
  • Benchmarking RAM performance - UWP and C#
  • How to set the response of a form post action to a iframe source?
  • Change div Background jquery
  • Qt: Run a script BEFORE make
  • reshape alternating columns in less time and using less memory
  • How to push additional view controllers onto NavigationController but keep the TabBar?