1
Ich versuche, eine verschachtelte Konstante in WPF verwenden, aber XAML scheint nicht geschachtelte statische Klassen zu behandeln.Zugriff auf geschachtelte statische const
namespace MyCommon.Constants
{
public static class Constants
{
public static class Formatting
{
public static class DateTime
{
public const string BritishDateToString = "dd-MM-yy";
}
}
}
}
Import der Namespace
xmlns:constants="clr-namespace:MyCommon.Constants;assembly=MyCommon"
die folgenden Zeilen gibt einen Fehler
<DataGridTextColumn Binding="{Binding Path=Date, StringFormat={x:Static constants:Constants.Formatting.DateTime.BritishDateTimeToString}}" Header="Date" />
werden können BritishDateToString sein sollte statisch – Florian
@Florian, const => statisch – ASh