How to bind a simple string value to a text box?

前端 未结 3 1627
太阳男子
太阳男子 2021-01-16 11:36

I am using wpf. I want to bind a textbox with a simple string type value initialized in xaml.cs class. The TextBox isn\'t showing anything. Here is my XAML code

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-16 12:20

    Just add this line in your EntitiesView constructor

    DataContext = this;
    

提交回复
热议问题