私は、リストビューの私のグループの説明のために列挙型を使用していると私はそれはいくつかのより多くのユーザーフレンドリーなテキストを表示しようとしていますが、私はエラーウィッヒがimpliciltyタイプ文字列がenum表示スペースとイメージを作成する方法はありますか?
列挙
public enum Mærke {
Alfa_Romeo,
Audi,
Aston_Martin__________________________________________________________5x114,
BMW,
Chervolet,
Chrysler,
Citroën,
Daewoo,
Daihatsu,
Dodge,
Ferrari };
public Mærke mærke { get; set; }
をMærkeに変換することができないと言う取得します
クラス
public class biler
{
public string billed { get; set; }
public string Model { get; set; }
public string Type { get; set; }
public string Årgang { get; set; }
public string Krydsmål { get; set; }
public double ET { get; set; }
public double centerhul { get; set; }
public string bolter { get; set; }
public string hjul { get; set; }
public Mærke mærke { get; set; }
}
一覧
items.Add(new biler() { billed = "img/Biler/aston martin.png", Model = "DB9", Årgang = "03-", Krydsmål = "5x114.3", ET = 62.5, centerhul = 68.1, bolter = "M14x2", mærke = Mærke.Aston_Martin__________________________________________________________________________________________________5x114 });
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView (hjuldata.ItemsSource);
PropertyGroupDescription groupDescription = new PropertyGroupDescription("mærke");
view.GroupDescriptions.Add(groupDescription);
how do i get a icon over here?
正直言って:私は問題を理解していないと何を達成しようとしています。 – ckruczek
他のすべてのものを除いて、 'Aston_Martin __________________________________________________________________________________________________ 5x114'は非常に良い名前ではないようです...特に列挙の中の唯一のAston Martinです。私はそれを 'Aston_Martin'と呼ぶか、2つの異なるAston Martinを区別する必要がある場合は、Aston_Martin_5x14を – SamYonnou
とすると、グループの説明で表示したい別の車のために異なるボルトの円があるからです。 –