0

XAML (Silverlight 2 アプリ用) でグループボックスのような要素を作成しようとしていますが、ひねりがあります。

通常、グループボックスはボーダーで構成され、メイン コンテンツはボーダーの内側に配置され、ヘッダー コンテンツはボーダー自体の上に配置されます。

私がやろうとしているのは、ヘッダー テキストを左側の境界線の上に配置し、270 度回転させて上部に揃えることです。しかし、回転変換を理解しようとすると頭が痛くなります。

変更したい既存のグループボックスの ControlTemplate は次のとおりです。

<ControlTemplate TargetType="Controls1:GroupBox">
  <Grid Background="{TemplateBinding Background}">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Border BorderThickness="{TemplateBinding BorderThickness}" Grid.Row="1" Grid.RowSpan="2" 
            BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3">
      <Border.Clip>
        <GeometryGroup FillRule="EvenOdd">
          <RectangleGeometry x:Name="FullRect" Rect="0,0,300,200"/>
          <RectangleGeometry x:Name="HeaderRect" Rect="6,0,100,100"/>
        </GeometryGroup>
      </Border.Clip>
    </Border>
    <ContentPresenter Grid.Row="2" ContentTemplate="{TemplateBinding ContentTemplate}" 
                      Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"/>
    <ContentControl x:Name="HeaderContainer" Margin="6,0,0,0" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Left" IsEnabled="False" >
      <ContentPresenter Margin="3,0,3,0" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" />
    </ContentControl>
  </Grid>
</ControlTemplate>

どんな助けでも大歓迎です!

4

1 に答える 1