Merge pull request #269 from irihitech/issue/264

Hide FormGroup header related features if header is null.
This commit is contained in:
Zhang Dian
2024-06-24 16:05:24 +08:00
committed by GitHub

View File

@@ -21,12 +21,18 @@
<ControlTheme x:Key="{x:Type u:FormGroup}" TargetType="u:FormGroup">
<Setter Property="Template">
<ControlTemplate TargetType="u:FormGroup">
<StackPanel Margin="0 28 0 0">
<ContentPresenter Content="{TemplateBinding Header}" FontWeight="Bold" FontSize="18" />
<StackPanel>
<ContentPresenter
Margin="0,28,0,0"
Content="{TemplateBinding Header}"
FontSize="18"
FontWeight="Bold"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Header, Converter={x:Static ObjectConverters.IsNotNull}}" />
<Rectangle
Height="1"
Margin="0,8"
HorizontalAlignment="Stretch"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Header, Converter={x:Static ObjectConverters.IsNotNull}}"
Fill="{DynamicResource SemiColorBorder}" />
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</StackPanel>