Jump to content
Software FX Community

Apply DataTemplate to marker on condition


Prodhomme
 Share

Recommended Posts

 Hi,

I'm having trouble to apply a data template on Marker using  ConditionalAttributes.

If I apply my template in AllSeriesAttributes, it is properly displayed, but it wont work in ConditionalAttributes.

My code looks like:

[color=blue;]<[/color][color=#a31515;]UserControl.Resources[/color][color=blue;]>[/color][color=#a31515;]	[/color][color=blue;]<[/color][color=#a31515;]DataTemplate[/color][color=red;] x[/color][color=blue;]:[/color][color=red;]Key[/color][color=blue;]=[/color][color=blue;]"myTemplate"[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]Polyline[/color][color=red;] x[/color][color=blue;]:[/color][color=red;]Name[/color][color=blue;]=[/color][color=blue;]"myShape"[/color][color=red;] Fill[/color][color=blue;]="{[/color][color=#a31515;]x[/color][color=blue;]:[/color][color=#a31515;]Static[/color][color=red;] Brushes[/color][color=blue;].[/color][color=blue;]Gold[/color][color=blue;]}[/color][color=blue;]"[/color][color=red;] Points[/color][color=blue;]=[/color][color=blue;]"18,0 21,13 35,12 23,20 28,33 18,23 7,33 12,20 0,12 14,13"[/color][color=blue;] />[/color][color=#a31515;][color=#a31515;]    [/color][color=blue;]</[/color][color=#a31515;]DataTemplate[/color][color=blue;]>[/color][color=#a31515;]	[/color][color=blue;]<[/color][color=#a31515;]DataTemplate[/color][color=red;] x[/color][color=blue;]:[/color][color=red;]Key[/color][color=blue;]=[/color][color=blue;]"myTemplateRed"[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]Polyline[/color][color=red;] x[/color][color=blue;]:[/color][color=red;]Name[/color][color=blue;]=[/color][color=blue;]"myShape"[/color][color=red;] Fill[/color][color=blue;]="{[/color][color=#a31515;]x[/color][color=blue;]:[/color][color=#a31515;]Static[/color][color=red;] Brushes[/color][color=blue;].[/color][color=blue;]Red[/color][color=blue;]}[/color][color=blue;]"[/color][color=red;] Points[/color][color=blue;]=[/color][color=blue;]"18,0 21,13 35,12 23,20 28,33 18,23 7,33 12,20 0,12 14,13"[/color][color=blue;] />[/color][color=#a31515;][/color][color=#a31515;]    [/color][color=blue;]</[/color][color=#a31515;]DataTemplate[/color][color=blue;]>[/color] [color=blue;]</[/color][color=#a31515;]UserControl.Resources[/color][color=blue;]>[/color]
[color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart[/color][color=red;] Gallery[/color][color=blue;]=[/color][color=blue;]"Radar"[/color][color=red;] ItemsSource[/color][color=blue;]="{[/color][color=#a31515;]Binding[/color][color=red;] PointCollection[/color][color=blue;]}[/color][color=blue;]"[/color][color=red;] [/color][color=blue;] >[/color][color=#a31515;]	[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.Template[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]ControlTemplate[/color][color=blue;]>[/color][color=#a31515;]			[/color][color=blue;]<[/color][color=#a31515;]Border[/color][color=red;] cfx[/color][color=blue;]:[/color][color=red;]Chart.PanelName[/color][color=blue;]=[/color][color=blue;]"Plot"[/color][color=blue;] />[/color][color=#a31515;]		[/color][color=blue;]</[/color][color=#a31515;]ControlTemplate[/color][color=blue;]>[/color][color=#a31515;]	[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.Template[/color][color=blue;]>[/color]  [color=#a31515;]    [/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.Series[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]SeriesAttributes[/color][color=red;] BindingPath[/color][color=blue;]=[/color][color=blue;]"ValueLow"[/color]   [color=red;] Stroke[/color][color=blue;]=[/color][color=blue;]"#FF68F16A"[/color]   [color=red;] Fill[/color][color=blue;]=[/color][color=blue;]"White"[/color][color=blue;] />[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]SeriesAttributes[/color][color=red;] BindingPath[/color][color=blue;]=[/color][color=blue;]"ValueNormal"[/color][color=red;] Stroke[/color][color=blue;]=[/color][color=blue;]"#FFF1A068"[/color][color=red;] Fill[/color][color=blue;]=[/color][color=blue;]"White"[/color][color=blue;]/>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]SeriesAttributes[/color][color=red;] BindingPath[/color][color=blue;]=[/color][color=blue;]"ValueHigh"[/color]  [color=red;] Stroke[/color][color=blue;]=[/color][color=blue;]"#FFF16868"[/color][color=red;] Fill[/color][color=blue;]=[/color][color=blue;]"White"/[/color][color=blue;]>[/color][color=#a31515;] [/color] [color=#a31515;]    [/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.Series[/color][color=blue;]>[/color]  [color=#a31515;]    [/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.AllSeries[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]AllSeriesAttributes[/color][color=blue;]>[/color][color=#a31515;]			[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]AllSeriesAttributes.Marker[/color][color=blue;]>[/color][color=#a31515;]				[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]MarkerAttributes[/color] [color=red;] Template[/color][color=blue;]="{[/color][color=#a31515;]StaticResource[/color][color=red;] myTemplate[/color][color=blue;]}[/color][color=blue;]"[/color][color=blue;]/>[/color][color=green;]<!--This works-->[/color][color=#a31515;]		    [/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]AllSeriesAttributes.Marker[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]AllSeriesAttributes[/color][color=blue;]>[/color][color=#a31515;]	[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.AllSeries[/color][color=blue;]>[/color][color=#a31515;]    [/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.ConditionalAttributes[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]ConditionalAttributes[/color][color=blue;] >[/color][color=#a31515;]			[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]ConditionalAttributes.Condition[/color][color=blue;]>[/color][color=#a31515;]				[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]RangeCondition[/color][color=red;] From[/color][color=blue;]=[/color][color=blue;]"0.5"[/color][color=blue;] />[/color][color=#a31515;]			[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]ConditionalAttributes.Condition[/color][color=blue;]>[/color][color=#a31515;]			[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]ConditionalAttributes.Marker[/color][color=blue;]>[/color][color=#a31515;]				[/color][color=blue;]<[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]MarkerAttributes[/color] [color=red;] Template[/color][color=blue;]="{[/color][color=#a31515;]StaticResource[/color][color=red;] myTemplateRed[/color][color=blue;]}[/color][color=blue;]"[/color] [color=blue;] />[/color][color=green;]<!--This doesn't work-->[/color][color=#a31515;]			[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]ConditionalAttributes.Marker[/color][color=blue;]>[/color][color=#a31515;]		[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]ConditionalAttributes[/color][color=blue;]>[/color][color=#a31515;]	[/color][color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart.ConditionalAttributes[/color][color=blue;]>[/color][color=#a31515;][/color] [color=blue;]</[/color][color=#a31515;]cfx[/color][color=blue;]:[/color][color=#a31515;]Chart[/color][color=blue;]>[/color]

Any explanation on this behavior?

[/color]Thanks
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...