Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

XAML - Access to the parent window of a page from this page

$
0
0

Hi everybody,

I have a Page that is hosted in a Window.
I would like to access to Window's properties from the XAML code of the Page (not from the .cs code, I already found the solution for that).

I tried to use FindAncestor to get the Window but it did not work (to set aLabel's content to the title of the parent Window).
<Label Content="{Binding Title, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>

Any idea ?

Thanks in advance for your suggestions.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>