How to set a binding in Code?

后端 未结 3 1110
深忆病人
深忆病人 2020-11-28 04:20

I have the need to set a binding in code.

I can\'t seem to get it right tho.

This is what i have tried:

XAML:



        
3条回答
  •  一向
    一向 (楼主)
    2020-11-28 05:17

    You need to change source to viewmodel object:

    myBinding.Source = viewModelObject;
    

提交回复
热议问题