Я преобразовал открытое свойство в открытую переменную, чтобы упростить код, и теперь механизм связывания в комбобоксе не работает.Разве я не могу использовать переменную вместо свойства?
Рабочий код: как свойство
internal class Utility
{
#region ReportOf
public enum ReportOf
{
Choose, All, Group, Person
}
private static Dictionary<ReportOf, string> _dictReportOf;
public static Dictionary<ReportOf, string> ReportOfCollection
{
get { return _dictReportOf; }
}
#endregion ReportOf
static Utility()
{
//initialize the collection with user friendly strings for each enum
_dictReportOf = new Dictionary<ReportOf, string>(){
{ReportOf.Choose, "Lütfen seçiniz..."},
{ReportOf.All, "Herkes"},
{ReportOf.Group, "Grup"},
{ReportOf.Person, "Şahıs"}};
}
}
Не работающий порт: Как переменная
internal class Utility
{
#region ReportOf
public enum ReportOf
{
Choose,
All,
Group,
Person
}
public static Dictionary<ReportOf, string> ReportOfCollection = new Dictionary<ReportOf, string>()
{
{ReportOf.Choose, "Lütfen seçiniz..."},
{ReportOf.All, "Herkes"},
{ReportOf.Group, "Grup"},
{ReportOf.Person, "Şahıs"}
};
#endregion ReportOf
static Utility()
{
//Nothing to do
}
}