feat: add group margin.

This commit is contained in:
rabbitism
2024-02-18 17:36:32 +08:00
parent 2bb4644c6d
commit e2f155a1dd
2 changed files with 14 additions and 1 deletions

View File

@@ -45,6 +45,19 @@
<u:FormItem Label="Please select a Date"> <u:FormItem Label="Please select a Date">
<CalendarDatePicker SelectedDate="{Binding Date}" /> <CalendarDatePicker SelectedDate="{Binding Date}" />
</u:FormItem> </u:FormItem>
<u:FormGroup Header="Education">
<TextBox
HorizontalAlignment="Stretch"
u:FormItem.IsRequired="True"
u:FormItem.Label="Name"
Text="{Binding Name}" />
<TextBox
HorizontalAlignment="Stretch"
u:FormItem.Label="Email"
u:FormItem.IsRequired="True"
Text="{Binding Email}" />
</u:FormGroup>
<u:FormItem Label="Click to Submit"> <u:FormItem Label="Click to Submit">
<Button Content="Button With Label" /> <Button Content="Button With Label" />
</u:FormItem> </u:FormItem>

View File

@@ -21,7 +21,7 @@
<ControlTheme x:Key="{x:Type u:FormGroup}" TargetType="u:FormGroup"> <ControlTheme x:Key="{x:Type u:FormGroup}" TargetType="u:FormGroup">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:FormGroup"> <ControlTemplate TargetType="u:FormGroup">
<StackPanel> <StackPanel Margin="0 28 0 0">
<ContentPresenter Content="{TemplateBinding Header}" FontWeight="Bold" FontSize="18" /> <ContentPresenter Content="{TemplateBinding Header}" FontWeight="Bold" FontSize="18" />
<Rectangle <Rectangle
Height="1" Height="1"