none
Binding textblock to window title not working as expected RRS feed

  • Question

  • Because the default caption wasn't appropriate for the main window of my application, I changed the window style and manually created my own caption using a TextBlock.

    Then I created a binding so that the TextBlock.Text  is bound to my custom NavigationWindow title:

      <TextBlock Width="Auto" Height="22" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type App:MyNavigationWindow}}, Path=Title, Mode=TwoWay}" />
     
    However, the binding works only partially, meaning: the TextBlock.Text shows the default title that I set in the XAML for the main window, but, if in the constructor of my custom NavigationWindow I change the window Title, this new value is not propagated to the TextBlock.Text. 

    Anybody knows why?

    Thanks in advance for any help or clue.




    Monday, March 5, 2007 9:16 PM