L
Lloyd Dupont
In my application I want to display some data in a list box.
I need to display the data as a picture.
My 1st idea was to create a ValueConverter to convert my datas to
ImageSource
But this has a few problem, the biggest one is there is no parameter!
So I though of MarkupExtension
something like that:
<ListBox ItemsSource={Binding Document.Maps}>
<ItemTemplate>
<Image Source="{local:Map2Image PreviewDpi=24, Background=false}" />
</ItemTemplate>
</ListBox>
but here, problem, in the Map2ImageExtension.ProvideValue(IServiceProvider)
I don't ave the current data, worst, I have no idea to get it.
I was able to get the IProvideValueTarget but it only knows about the
"Image" object, not about the current item.
I tried to look into the "Binding" and "BindingBase" code with reflector,
but I don't understand what's going on...
Any tip?
Otherwise I could write a specialized viewer FrameworkElement, but I though
of using MarkupExtension might be a nice way to solve the problem....
I need to display the data as a picture.
My 1st idea was to create a ValueConverter to convert my datas to
ImageSource
But this has a few problem, the biggest one is there is no parameter!
So I though of MarkupExtension
something like that:
<ListBox ItemsSource={Binding Document.Maps}>
<ItemTemplate>
<Image Source="{local:Map2Image PreviewDpi=24, Background=false}" />
</ItemTemplate>
</ListBox>
but here, problem, in the Map2ImageExtension.ProvideValue(IServiceProvider)
I don't ave the current data, worst, I have no idea to get it.
I was able to get the IProvideValueTarget but it only knows about the
"Image" object, not about the current item.
I tried to look into the "Binding" and "BindingBase" code with reflector,
but I don't understand what's going on...
Any tip?
Otherwise I could write a specialized viewer FrameworkElement, but I though
of using MarkupExtension might be a nice way to solve the problem....