1

I read it in this question: StaticResource Vs DynamicResource

A good example would be a forward reference to a resource defined later on in the XAML. So why would one define the resource later on at the first step and use DynamicResource, why not just define it before its use.

Do anybody have any example of a need to define the resource after its use in the xaml file ?

Community
  • 1
  • 1
teenup
  • 7,459
  • 13
  • 63
  • 122

2 Answers2

1

If you have a circular reference, e.g. the selected item in a list depends upon the value of a text field, and the value of the text field depends upon the selected item in the list,....

One control must be defined before the other.

ergohack
  • 1,268
  • 15
  • 27
0

Imagine you have deployed your app and then you design some cool skins. You do not want to redeploy the whole app just the skins. You just copy the XAML and skin is loaded - with static resource this is not possible.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • But this is the second case that skin is not available until runtime, not a forward reference because it is in a separate file, in forward reference we refer an x:key say at line number 10 and then define a resource with that x:key at line number 100 in the same xaml file. – teenup Nov 02 '10 at 10:33