diff --git a/src/Ursa.Themes.Semi/Controls/Form.axaml b/src/Ursa.Themes.Semi/Controls/Form.axaml
index 2449459..ee33650 100644
--- a/src/Ursa.Themes.Semi/Controls/Form.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Form.axaml
@@ -59,6 +59,7 @@
HorizontalAlignment="{TemplateBinding LabelAlignment}"
Orientation="Horizontal">
+ FontWeight="{DynamicResource TextBlockTitleFontWeight}"/>
obj.SetValue(NoLabelProperty, value);
public static bool GetNoLabel(Control obj) => obj.GetValue(NoLabelProperty);
#endregion
-
+
+ private Label? _label;
private List _formSubscriptions = new List();
public static readonly StyledProperty LabelWidthProperty = AvaloniaProperty.Register(
@@ -57,6 +63,8 @@ public class FormItem: ContentControl
static FormItem()
{
NoLabelProperty.AffectsPseudoClass(PC_NoLabel);
+ LabelProperty.Changed.AddClassHandler((o, e) => o.SetLabelTarget());
+ ContentProperty.Changed.AddClassHandler((o, e) => o.SetLabelTarget());
}
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
@@ -81,6 +89,36 @@ public class FormItem: ContentControl
}
}
+ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
+ {
+ base.OnApplyTemplate(e);
+ _label = e.NameScope.Find