Jump to content
Software FX Community

Collapsable LegendBox


Recommended Posts


 The following XAML is taken from your samples app:


<cfx:Chart Name="chart1" Border="{x:Static cfx:Borders.Classic}" Palette="{x:Static cfx:Palettes.Basic}" Style="{x:Static cfxmotifs:Simple.Style}"><cfx:Chart.LegendBox><cfx:LegendBox><cfx:LegendBox.ContainerStyle><Style TargetType="{x:Type ItemsControl}"><Style.Setters><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type ItemsControl}">

<Expander Header="Legend Box"><ItemsPresenter /></Expander></ControlTemplate></Setter.Value></Setter></Style.Setters></Style></cfx:LegendBox.ContainerStyle></cfx:LegendBox></cfx:Chart.LegendBox>


As I generate charts on the fly at runtime, how can I apply the LegendBox style in c#?

Asa sidenode, defaulting carriage returns to paragraphs on this forum makes pasting code hell...


Many thanks



Link to comment
Share on other sites

Move the style into one of your ResourceDictionaries (typically called App.xaml), add a x:Key attribute and then at runtime execute something like

chart1.LegendBox.ContainerStyle = (Style) FindResource("CollapsibleLegendStyle");



PS: We will research if we can fix the paste behavior.

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.

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.

  • Create New...