Jump to content
Software FX Community

Scroll Bar style in LegendBox


cvarro
 Share

Recommended Posts

We have a somewhat obscure property called MergeResources (note that is not browsable so it will not appear in IntelliSense) that we use to allow different styles - Glass, Basic, Simple - to have different common resources such as ScrollBar styles.

We did not use the Resources.MergeDictionaries WPF feature because of leaks when using this approach.

The following code will remove the scrollbar style included in our motif so that you can add your own, if you test this code against a Glass chart you will get a windows-themed scrollbar. You could then create your own ScrollBar style and add it to the resourceDictionary variable. Note that you have to set the MergeResources to point to a new resource dictionary as we do not track changes to the existing one.

ResourceDictionary resourceDictionary = new ResourceDictionary();

foreach (object key in chart1.MergeResources.Keys) {   if (key != typeof(System.Windows.Controls.Primitives.ScrollBar))   resourceDictionary.Add(key, chart1.MergeResources[key]);}

// resourceDictionary.Add(typeof(System.Windows.Controls.Primitives.ScrollBar), FindResource("MyScrollBar");chart1.MergeResources = resourceDictionary;

Regards,

JuanC

 

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...