나는 다음과 같은 이미지처럼 내 그룹 상자에 대한 사용자 지정 헤더를 만들어 :이 GroupBox.HeaderTemplate
나는이 헤더의 배경에서 바인딩을 설정 또한 원하므로 내가 쓴 다음 코드를
<GroupBox Width="130"
Height="80"
BorderBrush="Black"
Margin="5"
Grid.Row="0"
Background="{Binding HColor}">
<GroupBox.HeaderTemplate>
<DataTemplate>
<Border BorderBrush="Black"
BorderThickness="1"
CornerRadius="3"
HorizontalAlignment="Stretch"
Width="70"
Margin="-2,0,-3,-1"
Height="20"
Background="{Binding HColor}">
<TextBlock Text="Hubs"
Foreground="Black"
FontWeight="DemiBold"
HorizontalAlignment="Center" />
</Border>
</DataTemplate>
</GroupBox.HeaderTemplate>
</GroupBox>
실행 후, 나는이 그룹 상자의 배경이 올바른 방법으로 colord하지만, 하지 헤더!
는 잘 작동하지 않는 이유를 할 사람이 나에게 설명 할 수 있나요?
그런 식으로 작동하지 않습니다! 나는 전에 시험해 보았다. 그리고 헤더는 경계를 기술하고있는 끈이었다! 보기가 아닙니다. 감사합니다. @Ugur – NTinkicht
사실, 나는 노력했고 작동 중입니다. 나는 이미지를 가지고 있지만 저의 평판이 좋지 않아 이미지를 넣지 못하게합니다. – Ugur