3

I'm trying to style a LineSeries chart that has DateTime objects on its independent axis and integer values in its dependent axis. I want to show a tooltip text whenever a user overs his mouse on a DataPoint, showing both its independent and dependent values, but I need to format the DateTime object in order to display the formatation I would like.

I found this example that uses the property ContentStringFormat of a ContentControl, but after some digging I learnt that that property is not available in Silverlight, only on WPF. So I found another example that uses a converter, but I can't place the converter definition on the ResourseDictionary as I can on a UserControl, because a ResourceDictionary doesn't have the property Resources.. :(

I don't know if I explained myself right, but my question is.. Is it possible to supply a type converter for a static resource in Silverlight?

EDIT - XAML

Jeff Yates
  • 61,417
  • 20
  • 137
  • 189
jpgamaral
  • 51
  • 1
  • 4
  • Could you show us the xaml where you want to use the converter? – Emond May 11 '11 at 14:20
  • I've tried editing the post but it won't show up the code :/ – jpgamaral May 11 '11 at 15:25
  • Oh. I went ahead and pasted it on TinyPaste :D TY anyway! – jpgamaral May 11 '11 at 15:29
  • In a ResourceDictionary everything is a resource without having Resources tags enclosing them, so it shouldn't be a problem! I'm not sure though if you can use a StaticResource as converter parameter... – dain May 11 '11 at 15:30

1 Answers1

1

Take a look at this SO thread: Pass value of a field to Silverlight ConverterParameter

It has tons of different approaches for getting around converter limitations!

Community
  • 1
  • 1
dain
  • 6,475
  • 1
  • 38
  • 47