public string GetHeaderText() { var be = HeaderTextBlock.GetBindingExpression(TextBlock.TextProperty); be?.UpdateTarget(); return(HeaderTextBlock.Text); }
public ShowList() { InitializeComponent(); HeaderTextBlock.SetBinding(TextBlock.TextProperty, new Binding("HeaderText") { Source = this }); ItemsSource = new ObservableCollection <string>(); ItemsSource.CollectionChanged += ItemsSource_CollectionChanged; }