Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: Update suggestion: avalonDock:LayoutAnchorable bind title [22352]

$
0
0
I'm not able to bind to the avalonDock:LayoutAnchorable Title="" property.

This does not work:

```
<avalonDock:LayoutAnchorable Title="{Binding TestDebug}" >

```
Comments: ** Comment from web user: BoucherS **

Hi,

LayoutAnchorable is not part of the visualTree. therefor, binding won't work.

Try with a Proxy :
```
<Grid>
<Grid.Resources>
<FrameworkElement x:Key="ProxyElement"
DataContext="{Binding}" />
</Grid.Resources>

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

<xcad:DockingManager x:Name="_dockingManager">
<xcad:LayoutRoot x:Name="_layoutRoot">
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutAnchorablePaneGroup DockWidth="125">
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable ContentId="alarms"
Title="{Binding DataContext.MyTitle, Source={StaticResource ProxyElement}}">
<ListBox>
<s:String>Alarm 1</s:String>
<s:String>Alarm 2</s:String>
<s:String>Alarm 3</s:String>
</ListBox>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
</xcad:LayoutPanel>
</xcad:LayoutRoot>
</xcad:DockingManager>
</Grid>
```
and in code-behind :
```
public AvalonDockView()
{
InitializeComponent();

this.MyTitle = "ABC";
this.DataContext = this;
}

public static readonly DependencyProperty MyTitleProperty =
DependencyProperty.Register( "MyTitle", typeof( string ), typeof( AvalonDockView ), new UIPropertyMetadata( null ) );

public string MyTitle
{
get
{
return ( string )GetValue( MyTitleProperty );
}
set
{
SetValue( MyTitleProperty, value );
}
}
}
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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