这是我的 DataForm 的一部分
<Grid x:Name="LayoutRoot" Background="White">
<df:DataForm x:Name="df1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CurrentItem="{StaticResource descriptor}" CommandButtonsVisibility="All" AutoGenerateFields="False" >
<df:DataForm.EditTemplate>
<DataTemplate>
<StackPanel>
<df:DataField Label="Capital Cost" >
<TextBox Text="{Binding CapitalCost, Mode=TwoWay}" ></TextBox>
</df:DataField>
而不是明确指定标签“资本成本”,我想使用基础类型中的显示数据
public class Descriptor
{
[Display(Name = "Capital Cost:", Description = "The negotiated price of the car")]
public double CapitalCost
{
get
{
return _CapitalCost;
}
set
{
if (value > UsMsrp)
throw new ArgumentException("Capital Cost must be equal or less than US MSRP");
_CapitalCost = value;
}
}
描述很好地传递到界面,但就名称而言我很困惑
谢谢!