2015-05-07 2 views
1

Я возвращался к примеру и настраивал свойства для привязки к видимости и другим свойствам LayoutItem. Я могу настроить их на видимость или нет, но теперь я хочу отключить вкладки. У меня была привязка к IsEnabled в моем стиле, но теперь я не вижу свойства в классе LayoutItem. Поэтому я думаю, что могу добавить его во время исследования ToolKit. Но теперь я использую пакет Nuget, найденный в сети, и я не могу понять, как отключить вкладку панели. Любые идеи, способ отключить мои вкладки?Как отключить вкладки в Avalon Dock из Extended WPF Toolkit?

   <templateselectors:PanesStyleSelector> 
        <templateselectors:PanesStyleSelector.FileStyle> 
         <Style TargetType="{x:Type avalonDock:LayoutItem}"> 
          <Setter Property="IsEnabled" Value="{Binding IsEnabled, Mode=TwoWay}"></Setter> 
          <Setter Property="Title" Value="{Binding Model.Title}"/> 
          <Setter Property="IconSource" Value="{Binding Model.IconSource}"/> 
          <Setter Property="ContentId" Value="{Binding Model.ContentId}"/> 
          <Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"/> 
          <Setter Property="CanClose" Value="True"/> 
          <Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/> 
          <Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/> 
          <Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/> 
          <Setter Property="Height" Value="100"/> 
         </Style> 
        </templateselectors:PanesStyleSelector.FileStyle> 
       </templateselectors:PanesStyleSelector> 

ответ

1

Только что пробовал в моем наборе модов для док-станции Avalon. Добавлен следующий фрагмент моей собственной темы AvalonDock, и он позволяет отключить отдельные вкладки.

Для демонстрации я использовал IsSelected Свойство LayoutDocument, так как, конечно, нет IsEnabled.

<Style x:Key="DocumentPaneControlStyle" TargetType="{x:Type avalonDockControls:LayoutDocumentPaneControl}"> 
    <Setter Property="ItemContainerStyle"> 
     <Setter.Value> 
      <Style TargetType="{x:Type TabItem}"> 
       <Setter Property="IsEnabled" Value="{Binding IsSelected}"/> 
      </Style> 
     </Setter.Value> 
    </Setter> 
</Style> 
Смежные вопросы