Theme issue in Property grid scrollbars

Grids for WPF Forum

Posted 11 years ago by Anurodh Ora
Version: 4.5.0486
Avatar
Hi,

I am applying Office2007Blue theme to the PropertyGrid but theme is not being applied to the scrollbar at all.

Similarly, If property grid has ComoboBox as custom editor then theme is also not applying in combo box.

Is there any explicit way to assign theme for scrollbars and combo box.


Thanks

Anurodh

Comments (4)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Anurodh,

The PropertyGrid product does not theme any of the native WPF controls. The Ribbon product does offer themes for several of native WPF controls including scrollbars, and can be used in conjunction with the PropertyGrid.

You would need to explicitly assign the Style property for the controls (such as ComboBox) in a custom property editor. The Ribbon has a QuickStart that shows how to assign the Style property, and the PropertyGrid shows how to build custom editors.

The scrollbars will get a matching theme from the Ribbon automatically. Just be sure that ThemeManager.CurrentTheme is being set at app startup for best performance, as setting the theme on individual controls should typically only be used for testing.


Actipro Software Support

Posted 11 years ago by Anurodh Ora
Avatar
Hi,

I am applying Theme for Application in App.xaml.cs as

ThemeManager.CurrentTheme = "Office2007Blue";

The theme is being applied to all the controls except the scroll bar in property grid.


please look into this issue.


Thanks

Anurodh
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Please make sure that you are referencing the Ribbon assembly. If you are then please send over a sample project that shows the issue to our support address and we can take a look.


Actipro Software Support

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We've had a few others ask questions about how to accomplish this, so wanted to clarify the steps needed to properly theme the scrollbars in the PropertyGrid (or any control that uses ScrollViewer).

1. Reference Ribbon Assembly

The Ribbon assembly must be referenced, since it includes Styles for ScrollViewer and ScrollBar. So make sure you reference the Ribbon assembly in your project.

2. Set Desired Theme

The theme should typically be set at the application level, like so:
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application {
    public App() {
        ActiproSoftware.Windows.Themes.ThemeManager.CurrentTheme = ActiproSoftware.Windows.Themes.CommonThemeName.Office2007Blue.ToString();
    }
}
You can set the theme for specfic controls as well (instead of globally), but the implicit Style created in #3 would need to be duplicated in the Resources for the control in question.

3. Create Implicit Style for ScrollViewer

An implicit Style must be created so the Ribbon ScrollViewer Styles will be applied, like so:
<Application ...
        xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon">
    <Application.Resources>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="ScrollViewer"
                BasedOn="{StaticResource {x:Static ribbon:RibbonStyles.ScrollViewerAlternateKey}}" />
    </Application.Resources>
</Application>
This will apply the themed ScrollViewer Style to all the ScrollViewers in your application. Alternatively, you could define this Style on a specific Window or Control.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.