2015-04-03 18 views
5

मैं एक प्रोजेक्ट में एवलॉन डॉक का उपयोग कर रहा हूं और एन्केरियल फलक का उपयोग करना चाहता हूं, लेकिन नीचे दिखाई देने वाले टैब की बजाय, मैं इसे शीर्ष पर दिखाई देना चाहूंगा जैसे दस्तावेज़ फलक पर। मेरी प्रोजेक्ट के लिए, एक दस्तावेज़ फलक उचित नियंत्रण नहीं है, इसलिए मुझे एन्केरियल फलक को उसी तरह दिखने का तरीका ढूंढना होगा।मैं AvalonDock Anchorable पेन टैब को नीचे के बजाय शीर्ष पर कैसे स्थानांतरित करूं?

enter image description here

उत्तर

2

Issue Ticket found on CodePlex के अनुसार वहाँ एक बग है कि शीर्ष करने के लिए TabStripPlacement बदलते रोकता है। जिस तरह से इस लक्ष्य को हासिल करने के लिए इस तरह से एक के साथ मौजूदा शैली को बदलने के लिए है:

<Style x:Key="MyCustomAnchorablePaneControlStyle" TargetType="{x:Type xcad:LayoutAnchorablePaneControl}"> 

    <Setter Property="TabStripPlacement" Value="Top"/> 
    <Setter Property="Template"> 
     <Setter.Value> 
      <ControlTemplate TargetType="{x:Type xcad:LayoutAnchorablePaneControl}"> 
       <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local"> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="Auto"/> 
         <RowDefinition Height="*"/> 
        </Grid.RowDefinitions> 
        <!--Following border is required to catch mouse events--> 
        <Border Background="Transparent" Grid.RowSpan="2"/> 

        <xcad:AnchorablePaneTabPanel x:Name="HeaderPanel" Margin="2,0,2,2" IsItemsHost="true" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/> 

        <Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"> 
         <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> 
        </Border> 

       </Grid> 
       <ControlTemplate.Triggers> 
        <Trigger Property="IsEnabled" Value="false"> 
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> 
        </Trigger> 
       </ControlTemplate.Triggers> 
      </ControlTemplate> 
     </Setter.Value> 
    </Setter> 

    <Setter Property="ItemContainerStyle"> 
     <Setter.Value> 
      <Style TargetType="{x:Type TabItem}"> 
       <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/> 
       <Setter Property="ToolTip" Value="{Binding ToolTip}"/> 
       <Style.Triggers> 
        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}, Path=Items.Count}" Value="1"> 
         <Setter Property="Visibility" Value="Collapsed"/> 
        </DataTrigger> 
       </Style.Triggers> 
      </Style> 
     </Setter.Value> 
    </Setter> 

    <Setter Property="ItemTemplate"> 
     <Setter.Value> 
      <DataTemplate> 
       <xcad:LayoutAnchorableTabItem Model="{Binding}"/> 
      </DataTemplate> 
     </Setter.Value> 
    </Setter> 

    <Setter Property="ContentTemplate"> 
     <Setter.Value> 
      <DataTemplate> 
       <xcad:LayoutAnchorableControl Model="{Binding}"/> 
      </DataTemplate> 
     </Setter.Value> 
    </Setter> 

</Style> 
+1

अगर आप 'xcad पर मार्जिन बनाने: AnchorablePaneTabPanel' लाइन" 2,2,2,0 "तो वे बेहतर दिखती हैं। उस परिवर्तन के बिना वे शीर्ष पर नीचे टैब की तरह दिखते हैं। – zaknotzach

संबंधित मुद्दे