WPF usercontrol Twoway binding Dependency Property

后端 未结 2 1566
既然无缘
既然无缘 2020-12-05 19:33

I created a Dependency Property in the usercontrol, but however changes in the usercontrol was NOT notified to the Viewmodel

Usercontrol



        
2条回答
  •  不思量自难忘°
    2020-12-05 19:58

    An alternative way to do this is an ElementName Binding. First assign the x:Name attribute to the UserControl (for example x:Name="MyUC"), then change the binding to:

    
    

提交回复
热议问题