Manual data binding update in WPF MVVM

My ViewModel:

class ViewModel
{
public string FileName {get;set;}
}

and in mine ViewI bind the contents of the label to the ViewModel FileName.

now When I drag a file into my view, how can I update the label property Contentso that the ViewMode is FileNamealso updated via the binding?

Directly setting the label property Contentwill not work, just just clear the binding.

+3
source share
1 answer

3 quick choices ... (make sure the class implements INotifyPropertyChanged, and FileName is an event.)

+3

Source: https://habr.com/ru/post/1746224/


All Articles