Quantcast
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: LayoutAnchorable.Title not bindable [21902]

I know this has been reported in the past but I don't see any remarks or recent updates. When will the title for the LayoutAnchorable become bindable? In other words, the tab header is basically static once the tab is created and I'd like to update it from a bindable property so when I load a new document into my control the tab can reflect the name correctly.
Comments: ** Comment from web user: BoucherS **

Hi,

As stated on this site : http://stackoverflow.com/questions/7660967/wpf-error-cannot-find-govering-frameworkelement-for-target-element

"Sadly any DataGridColumn hosted under DataGrid.Columns is not part of Visual tree and therefore not connected to the data context of the datagrid. So bindings do not work with their properties such as Visibility or Header etc (although these properties are valid dependency properties!)."

The same way : LayoutAnchorables are not part of the VisualTree.

What you can do is apply the same solution :
```
<Grid>
<Grid.Resources>
<FrameworkElement x:Key="ProxyElement"
DataContext="{Binding}" />
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<ContentControl Visibility="Collapsed"
Content="{StaticResource ProxyElement}" />

<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" />

<xcad:DockingManager Grid.Row="2" MaxHeight="395"
AllowMixedOrientation="True"
BorderBrush="Black"
BorderThickness="1">
<xcad:LayoutRoot x:Name="_layoutRoot">
<xcad:LayoutRoot.LeftSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup x:Name="myGroup">
<xcad:LayoutAnchorable Title="{Binding DataContext.MyTitle, Source={StaticResource ProxyElement}}"
ContentId="agenda" IconSource="../Images/address-book-open.png">
<TextBlock Text="Agenda Content" Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap"/>
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable Title="Contacts" ContentId="contacts" IconSource="../Images/address-book--pencil.png" >
<TextBlock Text="Contacts Content" Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap"/>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.LeftSide>
</xcad:LayoutRoot>
</xcad:DockingManager>
</Grid>
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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