Hi All!
WPF is new to me, and I am stalled at a point.
I have an enum:
[Flags]
public enum Toners
{
black = 1,
cyan = 2,
magenta = 4,
yellow = 8
}
and a class, that has an indexer property based on this enum:
public string this[Toners toner]
{
get
{
return this.TonerLevels.ContainsKey(toner) ? this.TonerLevels[toner].ToString() : String.Empty;
}
}
Great, but I can't get any result when binding a textcolumn to it:
<DataGridTextColumn Header="Black" Binding="{Binding [Toners.blank]}" Width="100" CellStyle="{StaticResource CenterCellStyle}"/>
The same snippet is working when the index is of type int, and I am referencing it as
{Binding [1]}
Please guide me, how to make it work in the enum way if possible.
[Update]
I have also tried importing the namespace containing the enum directly into the xaml, and referencing the enum value both with "." and ":" notation, but still no result.
The worst is, that there is no error message either :(, only empty result. I suppose it would brig me closer, if I could increase somehow the verbosity of the xaml compilation, but I have no idea how.
Thank you.