我正在使用Avalondock 2.0版并设置为标头自定义可编辑的texbox控件。
但是当我更改标题文本时,消息不会调用
ViewModel(见<Setter Property="Title" Value="{Binding Model.DataContext.Caption, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
)。
我能解决这个问题吗?
<xcad:DockingManager Grid.Row="1" regions:RegionManager.RegionName="{x:Static common:RegionNames.DesignerRegion}"
Style="{DynamicResource CustomDockingManagerStyle}">
<xcad:DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<behaviors:EditableTextBlock x:Name="EditableTextBlock"
Text="{Binding Path=Title}"
TextBoxBorderColor="#C34442"
TextBlockForegroundColor="{DynamicResource AddButtonBackground}"
TextBoxForegroundColor="#7B3A3A"
TextBoxBackgroundColor="#FFF1E6"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"/>
</DataTemplate>
</xcad:DockingManager.DocumentHeaderTemplate>
<xcad:DockingManager.LayoutItemContainerStyleSelector>
<avalonBehaviors:PanesStyleSelector >
<avalonBehaviors:PanesStyleSelector.DocumentsStyle>
<Style TargetType="{x:Type xcad:LayoutItem}">
<Setter Property="Title" Value="{Binding Model.DataContext.Caption, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
</Style>
</avalonBehaviors:PanesStyleSelector.DocumentsStyle>
</avalonBehaviors:PanesStyleSelector>
</xcad:DockingManager.LayoutItemContainerStyleSelector>
<xcad:LayoutRoot >
<xcad:LayoutPanel >
<!--xcad:LayoutDocumentPaneGroup>
<xcad:LayoutDocumentPane />
</xcad:LayoutDocumentPaneGroup-->
<xcad:LayoutDocumentPane />
<xcad:LayoutAnchorablePane DockWidth="250" >
<xcad:LayoutAnchorable Title="Properties" AutoHideWidth="250">
<ContentControl regions:RegionManager.RegionName="{x:Static common:RegionNames.PropertiesRegion}"/>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutPanel>
<xcad:LayoutRoot.BottomSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Log Messages">
<TextBox IsReadOnly="True" Text="{Binding LogMessage}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"/>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.BottomSide>
</xcad:LayoutRoot>
</xcad:DockingManager>
由于