Problem

Issue with ThemeManager

Posted 2 years ago by Avatar Hamid Noorbakhsh

I have a simple project, just one window:

<Window x:Class="ActiProOfficeTheme.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:navigation="http://schemas.actiprosoftware.com/winfx/xaml/navigation"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <navigation:NavigationBar x:Name="navbar" SelectedIndex="1">
            <navigation:NavigationPane Title="Quak" />
            <navigation:NavigationPane Title="Muuh" />
        </navigation:NavigationBar>
    </Grid>
</Window>


Code in back:

public MainWindow()
{
    InitializeComponent();
    ThemeManager.SetTheme(navbar, ThemeName.OfficeBlack.ToString());
}

 I cannot get the Office Themes to change to the color I want. It is the Generic Theme always. If I apply other Themes, some work (High Contrast works), so what am I missing?


Comments (1)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Hamid,

We never recommend that you use the ThemeManager.SetTheme method because you will be loading a large number of resources for a single control.  That method is just for testing.  You really should be setting the ThemeManager.CurrentTheme property in your app startup before any UI loads instead.

Also, Office themes require a couple other lines of code to register them.  If you miss those steps then they will show as Generic.  Make sure you read through the "Actipro Themes" topics in the documentation that comes with WPF Studio.  It talks about all these things in detail.


Actipro Software Support
Information The latest build of this product (2014.2 build 0610) was released 2 months ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.