WPF TextBlock text Binding

后端 未结 2 1405
旧巷少年郎
旧巷少年郎 2020-12-20 19:21

the TextBlock binding does not work and I cant figure why...

(This Code Works but the TextBlock does not get Updated )

XAML



        
相关标签:
2条回答
  • 2020-12-20 20:03

    Try this:

    <TextBlock x:Name="filterAllText" 
        Text="{Binding UpdateSourceTrigger=PropertyChanged, Path=MyCoynt}" />
    

    And set your DataContext like:

    filterAllText.DataContext = LogSession.test;
    
    0 讨论(0)
  • 2020-12-20 20:06
    <TextBlock x:Name="filterAllText" Text="{Binding Path=., UpdateSourceTrigger=PropertyChanged}" />
    

    this should work but its not the usual way

    EDIT: the better way is the anwser from Goanne

    0 讨论(0)
提交回复
热议问题