在我的 WPF 应用程序中,我使用了来自扩展 WPF 工具包的 TimePicker 控件。当我运行应用程序时,TimePicker 控件应将默认值显示为“12:00 AM”。目前它显示我空白。如何达到这个结果?
Xml代码:
<xctk:TimePicker x:Name="StartValue" Value="{Binding StartTimeBinding,
ElementName=MainWin, Mode=TwoWay}" Format="Custom" FormatString="hh:mm tt"
Background="Yellow" Padding="0" Margin="0" BorderThickness="0" Width="100"
EndTime="11:59:0"/>
<xctk:TimePicker x:Name="StopValue" Value="{Binding StopTimeBinding,
ElementName=MainWin, Mode=TwoWay}" Format="Custom" FormatString="hh:mm tt"
Background="Yellow" Padding="0" Margin="0" BorderThickness="0" Width="60"
EndTime="11:59:0"/>
TimePicker
绑定到以下属性的控件:
public string StartTimeBinding
{
set
{
this._id = value;
}
get
{
return this._started_at.ToString("h:mm tt");
}
}
public string StopTimeBinding
{
set
{
this._id = value;
}
get
{
return this._ended_at.ToString("h:mm tt");
}
}