禁用 WPF Material 设计时间选择器提示文本

Disable WPF Material Design Timepicker Hint Text

我正在使用 Material 设计 TimePicker 来花一些时间输入。时间选择器工作正常。但我对风格有疑问。我想从默认显示 "select time" 的控件中删除提示文本。

control = new MaterialDesignThemes.Wpf.TimePicker { Name = "timepicker_" + df.dataName, SelectedTime = null, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
this.RegisterName("timepicker_" + df.dataName, control);

我正在从后台代码创建控件。这两行的输出是

我想从 time pickermcontrol 中删除这个提示帮助文本。来自后面的代码。

HintAssist.Hint 附加 属性 设置为 string.Emptynull:

control = new MaterialDesignThemes.Wpf.TimePicker { Name = "timepicker_" + df.dataName, SelectedTime = null, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };

MaterialDesignThemes.Wpf.HintAssist.SetHint(control, string.Empty);