GetText on a WPF application not working

Hi all,

I am trying to get the text inside a TextBlock of my WPF application.
This is the TextBlock in my application:

<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding PopupMessage}"
                   VerticalAlignment="Center" TextWrapping="Wrap"

I already tried:

var element= driver.FindElementByAccessibilityId(“BatteryPopupScreen_MessageText”);
return element.Text;

I want to get ‘Text’ field here, but when calling ‘element.Text’ I get ‘MessageText’

I tried instead of ‘element.Text;’ to use ‘GetAttribute(“Text”)’ and it returns ‘MessageText’ as well. I tried to use ‘GetProperty(“Text”);’ and it throws an exception.

How to get the binded text here?