0

を使用していExtended Toolkit propertyGridます。ユーザー定義の言語設定に従ってカスタマイズする必要があります。このチュートリアルから、表示名やその他の機能をハードコードで変更できることがわかりました。

public class Customer
{
    public int ID { get; set; }

    [ExpandableObject]
    [Category("General settings")]<-------hard coded feature change
    [DisplayName("Nome persona")]<--------hard coded feature change
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public Gender Gender { get; set; }
    public DateTime BirthDate { get; set; }
    public string Phone { get; set; }
}
public enum Gender { Male, Female }

}

しかし、私はランタイムでそれを行う必要があります! ご協力ありがとうございました

4

1 に答える 1

0

これらは XAML でカスタマイズできます。

このクラスの例:

public class MyVMEntry
{
    public string Property1 { get; set; }
    public string Property2 { get; set; }
}

の表示を変更Property1:

<xt:PropertyGrid SelectedObject="{Binding}" AutoGenerateProperties="True">
    <xt:PropertyGrid.PropertyDefinitions>
        <xt:PropertyDefinition Name="Property1" DisplayName="First Property" Category="Special"/>
    </xt:PropertyGrid.PropertyDefinitions>
</xt:PropertyGrid>

XAML では、ランタイムに依存するものが必要な場合は、静的文字列を使用する代わりに値を動的にバインドできます。

于 2016-11-30T12:50:13.097 に答える