Binding to static property

后端 未结 12 2390
夕颜
夕颜 2020-11-22 05:14

I\'m having a hard time binding a simple static string property to a TextBox.

Here\'s the class with the static property:



        
12条回答
  •  感动是毒
    2020-11-22 05:34

    If the binding needs to be two-way, you must supply a path.

    There's a trick to do two-way binding on a static property, provided the class is not static : declare a dummy instance of the class in the resources, and use it as the source of the binding.

    
        
    
    ...
    
    
    

提交回复
热议问题