Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
How to set Scroll Viewer Styling in Floating Content Pane?
posted

Hi,

In my application i am using xamDockManager, where there a content pane which can float. Once we drag and make it Floating window, it's scroll bar color changes to default grey color, We want to change this default grey color to NavyBlue.

As suggesred in other post we need to add styling in App.xaml file. But as I am hosting WPF forms from WinForm, so that it's hard to set the styling in App.xaml as I am not adding styling here. 

I have referred a sample provided here and created a AppResources.xaml file and added styling to that file.

My requirement is what style is to be added to change the color of the scroll bar when we make our content pane Floating window(Separate tool window)?

How my scroll bar looks like when the content pane is docked-:

How my scroll bar looks like when the content pane is made floating window-:

Kind Regards,

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Sachin,

    It is difficult to say why the styling is not being applied to your ToolWindow at the moment, and without seeing the actual styling that you are applying, I cannot be sure why it is not applying.

    One thing that I can say in theory is that the behavior you are seeing could be due to the hosting of your WPF forms in a Windows Forms application, because as you had mentioned, there will not be an App.xaml file to globally apply your styles to all visual trees of the application. When you float a window in the XamDockManager, that window is in its own visual tree and not in the same scope as the XamDockManager (or the window that owns it) anymore. The App.xaml works around that, as that applies to all of the visual trees in the scope of the application, but this doesn’t exist in Windows Forms.

    It would be most helpful in this case if you can provide an isolated sample that shows the exact issue you are seeing. I am aware that you are basing on the sample in the other forum thread, but this does not demonstrate the issue you are seeing. If you could potentially modify the sample from the other forum thread such that it does, I will gladly take a look and attempt to offer a resolution.

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data