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
755
Set application theme
posted

Hi all

I want to apply the Office2013Theme with ThemeManager on my XamRibbonWindow but it does not work. I try as follow

The XAML file

<ribbon:XamRibbonWindow x:Class="BackupCustomizing.MainWindow"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                        xmlns:ribbon="http://schemas.infragistics.com/xaml/wpf"
                        xmlns:view="clr-namespace:BackupCustomizing.Views"
                        xmlns:ignore="http://www.ignore.com"
                        mc:Ignorable="d ignore"
                        Height="400"
                        Width="800"
                        Title="Backup customizing"
                        DataContext="{Binding Main, Source={StaticResource Locator}}" ResizeMode="NoResize" >

    <ribbon:RibbonWindowContentHost x:Name="contentHost"
                                    Theme="Office2013"
                                    ribbon:RibbonWindowContentHost.ApplicationAccentColor="#0072C6">

        <Grid x:Name="LayoutRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="230" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <view:NavigationView Grid.Column="0" Padding="10 0 0 0" />
        </Grid>
    </ribbon:RibbonWindowContentHost>
</ribbon:XamRibbonWindow>

and the code

using BackupCustomizing.ViewModel;
using Infragistics.Themes;
using Infragistics.Windows.Ribbon;

namespace BackupCustomizing
{
    /// <summary>
    ///     Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : XamRibbonWindow
    {
        /// <summary>
        ///     Initializes a new instance of the MainWindow class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            ThemeManager.SetTheme(contentHost, new Office2013Theme());
            Closing += (s, e) => ViewModelLocator.Cleanup();
            
        }
    }
}

But the wpf controls show me with windows default theme,

What am I doing wrong?

Thanks